-
Notifications
You must be signed in to change notification settings - Fork 591
feat: Add is_remote flag in exporter for spans and span links #3153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add is_remote flag in exporter for spans and span links #3153
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3153 +/- ##
=====================================
Coverage 80.6% 80.7%
=====================================
Files 126 126
Lines 22195 22286 +91
=====================================
+ Hits 17898 17986 +88
- Misses 4297 4300 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Implements span flags support for the isRemote property in the OTLP exporter as specified in issue #3152. This change enables proper setting of OTLP span flags based on whether the parent span context is remote or local.
- Added
parent_span_contextfield toSpanDatastructures to store parent span context information - Implemented
build_span_flagsfunction to set appropriate flags (0x100 for local, 0x300 for remote spans) - Updated all span creation sites to include the new field and comprehensive test coverage
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| opentelemetry-sdk/src/trace/export.rs | Added parent_span_context field to public SpanData struct |
| opentelemetry-sdk/src/trace/span.rs | Added field to internal SpanData and updated export data building |
| opentelemetry-sdk/src/trace/tracer.rs | Populated parent_span_context field during span creation |
| opentelemetry-proto/src/transform/trace.rs | Implemented build_span_flags function and updated span/link transformations |
| opentelemetry-zipkin/src/exporter/model/span.rs | Updated test data with new field |
| opentelemetry-sdk/src/trace/span_processor.rs | Updated test span data creation |
| opentelemetry-sdk/src/testing/trace/span_exporters.rs | Updated test helper function |
| opentelemetry-sdk/benches/batch_span_processor.rs | Updated benchmark span data |
| opentelemetry-otlp/src/exporter/http/mod.rs | Updated test span data |
| opentelemetry-sdk/CHANGELOG.md | Documented the new feature |
| opentelemetry-proto/CHANGELOG.md | Documented the transformation changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Replace Option<SpanContext> with bool for parent_span_is_remote field - Eliminates unnecessary cloning of SpanContext objects - More efficient memory usage and cleaner API - Updated build_span_flags function to accept boolean parameter - Updated all test files to use new boolean field - Maintains same functionality with better performance Addresses reviewer feedback for more efficient implementation.
- Put function parameters on single line to match rustfmt requirements - Fixes linting error in CI
- Remove unused local_parent and remote_parent variables - These were left over from the refactoring to use boolean parameters - Fixes compilation errors in CI
Fixes #3152
Design discussion issue (if applicable) #
Changes
Update OTLP exporter to fill the relevant bits in SpanFlags.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes