-
Notifications
You must be signed in to change notification settings - Fork 650
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
Stop TracerProvider from being overridden #959
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.
Should this same change be done for the meter provider?
Fixed |
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.
Nice!
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.
LGTM!
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Description
The actual behavior allows overriding of the current
TracerProvider
. Setting ofTracerProvider
can happen in the auto instrumentation steps and later it can be overridden in application code, causing span processors to be lost.Fixes #958
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
This PR introduces a change in the following test that asserts that the appropriate warning is raised and that the tracer provider is not overridden even after calling
set_tracer_provider
twice.opentelemetry-api/tests/trace/test_globals.py:test_tracer_provider_override_warning
Checklist: