-
Notifications
You must be signed in to change notification settings - Fork 572
fix: Suppress telemetry emitted inside of BatchLogProcessor::emit
#3172
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: Suppress telemetry emitted inside of BatchLogProcessor::emit
#3172
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3172 +/- ##
=======================================
- Coverage 80.7% 80.7% -0.1%
=======================================
Files 126 126
Lines 22328 22329 +1
=======================================
- Hits 18028 18025 -3
- Misses 4300 4304 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
970f74c
to
96359fc
Compare
BatchLogProcessor::emit
BatchLogProcessor::emit
This approach seems fine to me. Another option would be to use an atomic flag (similar to |
Thinking more, I would be cautious about adding any latency to the hot-path in user thread. The opentelemetry-rust/opentelemetry/benches/context_suppression.rs Lines 11 to 16 in 9bd2c1b
|
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.
as discussed here - #3172 (comment)
Better to have perf numbers for the change.
I would like to run some more alternative fixes by you before finalizing this approach. I had initially prevented the call to If you wish, I may move the context suppression in the same branch as the |
@lucamuscat I think that moving the suppression around the offending |
…avoid the added overhead of suppressing telemetry in the happy path
Telemetry suppression has been moved out of the happy path and right before the offending |
+1. That was the plan for other places hitting (potentially hitting) this issue. |
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!
Fixes #3161
Design discussion issue (if applicable) #
Changes
The
BatchLogProcessor
background thread itself runs with a telemetry suppressed context, however,BatchLogProcessor::emit
does not use a telemetry suppressed context as it is executed in the caller's thread, as opposed to the suppressed background thread.Using a telemetry suppressed context whilst calling
BatchLogProcessor::emit
fixes the issue where telemetry-induced-telemetry is generated whilst callingemit
on a shutdownBatchLogProcessor
, avoiding a stack overflow.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes