-
Notifications
You must be signed in to change notification settings - Fork 848
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
Add experimental updateTracerConfigurations for dynamically updateable on/off instrumentation #6899
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 #6899 +/- ##
============================================
- Coverage 90.30% 90.25% -0.06%
- Complexity 6594 6595 +1
============================================
Files 729 729
Lines 19784 19799 +15
Branches 1945 1945
============================================
+ Hits 17866 17869 +3
- Misses 1325 1338 +13
+ Partials 593 592 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Thanks for starting to think about this. I think we need to have an API that solves the dynamic config problem for generically, rather than focusing specifically on tracer config. What do you think about something like this: jack-berg@f74db3e#diff-8a27a2383ac52aa80c19c1c9789bf6c91e2c336c702f9bb4943e5e8cce7d07e0R103-R129 Demonstrated in a test here: jack-berg@f74db3e#diff-cb1bd4f971c5bffe08539f05be0e05fe0750268975f448c45dcd78debd6775ecR257-R278 having a |
Per our conversation in yesterday's SIG about having scope config part of declarative configuration, I've opened this PR: open-telemetry/opentelemetry-configuration#140 |
Isn't this very specific to the tracer provider implementation? I get what you mean about it not just being for tracers, but that signature doesn't generalize to the TracerProvider interface. Also seems overkill to require the full SdkTracerProvider when you only want the (ScopeConfigurator) tracerConfigurator from that. I can see the benefit of an |
I meant that we need to think about: 1. All the parts of SdkTracerProvider that may need to be updated 2. How we do the same for SdkMeterProvider, SdkLoggerProvider.
Yeah its a matter of what type of API ergonomics we want. Single
|
I prefer the second approach too. It'll take me some time to find time (heh) and I'll convert this PR to that approach for the Tracers. I'd rather not do the meters and loggers just yet if that's okay? |
Yes let's establish the pattern in an initial, and then expand the scope. Should start with just |
This enables dynamic config - it's all that is needed at the experimental level. For the complete solution it would be a
TracerProvider.updateTracerConfigurations()
interface method addition.A usage example is https://github.com/elastic/elastic-otel-java/blob/main/custom/src/main/java/co/elastic/otel/config/DynamicInstrumentation.java
Essentially, the configuration is set with an updatable ScopeConfigurator (see below fragment), then that can be updated at any time with eg
GlobalOpenTelemetry.getTracerProvider().updateTracerConfigurations()
I haven't added implementations for
DefaultTracerProvider
andExtendedDefaultTracerProvider
nor tests, because I feel this is fine for the experimental stage, but those could be added easily