-
Notifications
You must be signed in to change notification settings - Fork 513
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
fix: use the correct tracing id and attributes in logs when nested within a tracing span #2924
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2924 +/- ##
=====================================
Coverage 81.3% 81.3%
=====================================
Files 126 126
Lines 24254 24312 +58
=====================================
+ Hits 19736 19785 +49
- Misses 4518 4527 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey @SF-Zhou thanks for opening the PR! |
Sure. The description of the PR has been updated. |
8a40208
to
1f41d19
Compare
@bantonsson I think your eyes on this would be helpful! |
Fixes #2824 and #1378.
Changes
#2438 has already extracted the trace ID and span ID information from the tracing span, but has not handled the attributes. For instance:
in
tracing::error!("event")
, the body is processed, butfield1
andfield2
are ignored. This commit attempts to fix that issue.Additionally, when using distributed tracing and calling
set_parent
to set the context, the currently obtainedtrace_id
was incorrect. This PR also fixes this issue.This fix has been validated in online production environments. For users with the same requirements, they can temporarily opt to use the patched
opentelemetry-appender-tracing-patched
crate.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes