-
-
Notifications
You must be signed in to change notification settings - Fork 226
fix(logs): Structured Logs do not send ParentSpanId when no Span was active #4565
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4565 +/- ##
=======================================
Coverage 73.47% 73.48%
=======================================
Files 482 482
Lines 17679 17678 -1
Branches 3495 3493 -2
=======================================
+ Hits 12989 12990 +1
Misses 3799 3799
+ Partials 891 889 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@sentry review |
alexsohn1126
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.
A couple of possibly dumb questions 😛
e9c3cbd to
5b42cad
Compare
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.
Looks good! Thanks for answering my questions 💯
This is a follow-up PR
from #4462 (comment)
that is applying a change we made for the
Serilogintegration of Structured Logsto the SDK-Logger and the
Microsoft.Extensions.Loggingintegration,when reading values for the attributes
"trace_id"and"sentry.trace.parent_span_id".Rather than using the
TraceHeader,instead use the currently active Span, or the Propagation Context as a fallback.
During testing I noticed, that there doesn't seem to be a behavioral difference in Sentry, hence the#skip-changelog.Note
Structured Logs now derive
trace_idfrom the active span or scope and only includesentry.trace.parent_span_idwhen an active span exists.trace_id/parent_span_idviaSentryLog.GetTraceIdAndSpanId(...)from the activeSpan; fall back to scope fortrace_idonly.sentry.trace.parent_span_idwhen no active span.Sentry.Extensions.Logginglogger andDefaultSentryStructuredLoggernow use the new helper (replacingGetTraceHeader).Sentry.Serilogsink uses the helper; removes its local resolver.SentryLogcore type.parent_span_idwithout an active span.Written by Cursor Bugbot for commit 2326d97. This will update automatically on new commits. Configure here.