-
Notifications
You must be signed in to change notification settings - Fork 851
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
AutoConfiguredOpenTelemetrySdkBuilder does not set GlobalOpenTelemetry by default #5564
AutoConfiguredOpenTelemetrySdkBuilder does not set GlobalOpenTelemetry by default #5564
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #5564 +/- ##
============================================
- Coverage 91.40% 91.38% -0.03%
+ Complexity 4963 4961 -2
============================================
Files 550 550
Lines 14569 14569
Branches 1358 1358
============================================
- Hits 13317 13314 -3
- Misses 866 868 +2
- Partials 386 387 +1
☔ View full report in Codecov by Sentry. |
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.
👍🏽
…y-java into autoconfigure-default-global
@jack-berg |
Yikes @gabrieljones. I'll open an issue / PR to fix that. |
See issue open-telemetry/opentelemetry.io#3692. |
Edit: If I get rid of all of those then the warning should go away. Original:
warning also seems to "encourage" the use of Attempting to resolve this warning led me into a head on collision with the advice not to use GlobalOpenTelemetry. Is there a way to suppress this warning so that the users of my app are not spooked. Right now I do: val openTelemetry: OpenTelemetry = AutoConfiguredOpenTelemetrySdk.builder.build().getOpenTelemetrySdk Is there a more correct way to retrieve a non Global instance of |
Yup - maybe we should log something more clear / actionable 🤔 |
GlobalOpenTelemetry makes you opt into initializing with autoconfigure by setting a environment variable / system property.
In contrast, AutoConfiguredOpenTelemetrySdk will set GlobalOpenTelemetry by default. This PR aligns AutoConfiguredOpenTelemetrySdk with the opt-in behavior of GlobalOpenTelemetry, and also with our general advice discouraging use of GlobalOpenTelemetry.
Also, this PR changes AutoConfiguredOpenTelemetrySdkBuilder#setResultAsGlobal(boolean) to simply be AutoConfiguredOpenTelemetrySdkBuilder#setResultAsGlobal(). This means there is no option to undo a decision to
setResultAsGlobal
after its previously been invoked.This aligns with our builders elsewhere.