-
Notifications
You must be signed in to change notification settings - Fork 549
refactor: Align global trace with metrics #3078
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?
refactor: Align global trace with metrics #3078
Conversation
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
This PR aligns the behavior of the global tracer provider with the global metrics provider by modifying the set_tracer_provider
function to not return the previous provider and adding error handling that returns noop implementations with logging instead of panicking.
- Changed
set_tracer_provider
return type fromGlobalTracerProvider
to unit - Added graceful error handling for RwLock poisoning with logging instead of panics
- Replaced
mem::replace
with direct assignment for consistency with metrics implementation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
opentelemetry/src/global/trace.rs | Modified tracer provider functions to handle errors gracefully and align API with metrics |
opentelemetry/CHANGELOG.md | Added changelog entry documenting the breaking API change |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3078 +/- ##
=====================================
Coverage 80.1% 80.2%
=====================================
Files 126 126
Lines 21949 21949
=====================================
+ Hits 17603 17604 +1
+ Misses 4346 4345 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bot findings
Changes
This pull requests align setting global tracer with settings global metrics - mem::replace was replaced with mutable assignment and old tracer is no longer returned.
In addition failure to set global tracer does not crash program anymore - it will return noop and log error - like with global metrics
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes