-
Notifications
You must be signed in to change notification settings - Fork 611
feat(appender-tracing): add experimental span attributes enrichment #3282
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
base: main
Are you sure you want to change the base?
feat(appender-tracing): add experimental span attributes enrichment #3282
Conversation
…s with span context
…y-rust into feature/include-span-attributes-in-logrecords
…://github.com/leghadjeu-christian/opentelemetry-rust into feature/include-span-attributes-in-logrecords
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3282 +/- ##
======================================
Coverage 80.5% 80.5%
======================================
Files 129 129
Lines 23294 23496 +202
======================================
+ Hits 18756 18935 +179
- Misses 4538 4561 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| #[test] | ||
| #[cfg(feature = "experimental_span_attributes")] | ||
| fn test_span_context_enrichment_enabled() { |
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.
can you add a test for nested spans? I am curious on how that works as well...
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.
I added a new test test_nested_spans_use_innermost_attributes
that verifies nested span behavior. It confirms that events correctly associate with the innermost active span and only include its attributes, ensuring proper scoping.
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.
why we restrict to innermost active span? That'd mean we lose everything from non-innermost span, partially defeating the purpose. We should get attributes from all spans.
We can look at how fmt subscriber handles this, and mimic its behavior closely.
cijothomas
left a comment
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.
Thanks for working on this. I left comments. We need to do this with high performance, avoiding allocations wherever feasible.
Also, we need to have tests for nested spans.
please check comments.
…://github.com/leghadjeu-christian/opentelemetry-rust into feature/include-span-attributes-in-logrecords
…nd StoredSpanAttributes
…://github.com/leghadjeu-christian/opentelemetry-rust into feature/include-span-attributes-in-logrecords
|
Pinging to discussion #3282 (comment) about using attributes from innermost span only vs everything. |
Fixes #3221
Design discussion issue (if applicable) #
Changes
Add experimental
experimental_span_attributesfeature to enrich log records with attributes from active tracing spans.When enabled, span attributes are automatically included in log records. Event attributes take precedence on conflicts.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes