Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for span links to the fastrace library, resolving issue #148. Span links allow spans to reference other spans without establishing strict parent-child relationships, which is a standard feature in OpenTelemetry.
Changes:
- Adds
with_link()andadd_link()methods to bothSpanandLocalSpanAPIs for adding span links - Deprecates
enter_with_parents()method, converting multi-parent functionality to use the first parent with additional parents as links - Refactors internal architecture: changes
CollectTokenfromVec<CollectTokenItem>to a single struct, and changespropertiesfield fromOption<Vec>toVecdirectly
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| fastrace/src/span.rs | Adds with_link and add_link methods, deprecates enter_with_parents, refactors CollectToken usage |
| fastrace/src/local/local_span.rs | Adds with_link and add_link methods for LocalSpan |
| fastrace/src/local/raw_span.rs | Adds links field, changes properties to non-optional, derives Clone |
| fastrace/src/collector/mod.rs | Adds links field to SpanRecord, refactors CollectToken to single struct |
| fastrace/src/collector/global_collector.rs | Adds Link handling in DanglingItem enum and processing logic |
| fastrace/src/collector/id.rs | Adds PartialEq and Eq derives to SpanContext for test assertions |
| fastrace-opentelemetry/src/lib.rs | Adds map_links function to convert fastrace links to OpenTelemetry format |
| fastrace/src/local/span_queue.rs | Adds add_link and with_link methods |
| fastrace/src/local/local_span_line.rs | Adds link handling methods, refactors token handling |
| fastrace/src/local/local_span_stack.rs | Adds link handling methods |
| fastrace/src/util/tree.rs | Updates to use single CollectToken instead of Vec |
| fastrace/src/util/mod.rs | Removes CollectToken type alias (moved to collector module) |
| fastrace/src/event.rs | Changes properties to non-optional, fixes doc example |
| fastrace/tests/lib.rs | Adds tests for span links, removes deprecated multi-parent test |
| tests/statically-disable/src/main.rs | Updates test to use new link APIs |
| examples/synchronous.rs | Updates to use with_properties instead of with_property |
| examples/asynchronous.rs | Updates to use with_properties instead of with_property |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #148