-
Notifications
You must be signed in to change notification settings - Fork 893
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 simple scope configuration to Tracer, Meter, Logger #3877
Conversation
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Glad to see this (Erlang/Elixir actually still has an undocumented ability to disable Tracer's per-scope that exists I believe because of a very early spec iteration) but I'm not sure it should be a "Provider". If it is a function and not a stateful "object" it doesn't sound like a Provider to me. The TracerProvider already feels like the TracerConfigProvider while the per-scope configuration is a part of its configuration. Random other thoughts: I recall talk of things like SamplerProviders to make it possible to configure per-scope, but I like the idea of making tracer configuration a per-scope thing. I believe there was also the idea that if you wanted different configurations you used different TracerProviders, removing the need for per-scope configuration, but there was nothing about configuring specific scopes to use specific providers. |
Any recommendations for alternative names? Other options I considered:
I think scope config is the natural way to accommodate that type of thing. Easy to imagine evolving TracerConfig with another option for the specific sampler that should be used with that tracer.
Yes, no way to specify that a particular scope should use a specific provider. This is especially true in auto instrumentation scenarios like the otel java agent. Even if it were possible, it would be pretty awful to have a different batch span processor and span exporter for each scope. |
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.
The name TracerConfigProvider
can carry the following implicit semantics, comparing it with existing providers:
- There is a
TracerConfigProvider
singleton somewhere - Applications are to set this singleton
- TracerProvider are to use this singleton
In my understanding, this is not the case, and TracerConfigProvider
will be an additional property of a TracerProvider.
In this case, I would rename it to TracerConfigurator
(changed), which produces TracerConfig
(unchanged)
I have no problem with |
Based on feedback, I pushed a commit which renamed to |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
@open-telemetry/specs-approvers please take a look. This solves an important use case, has decent level support as indicates in the comments of #3877, and fixes a conceptual gap in the current lack of sdk tools around scope. Merging this would be good for SDKs. |
As mentioned here, this PR doesn't introduce dynamic config, but it is designed to be performant in a future world where dynamic config is better understood and supported.
We need to explore this more, but doing so shouldn't block this PR. Currently, there is no API for instrumentation to determine if a particular Tracer / Meter / Logger is enabled. This means that even with this PR, instrumentation can't be optimized to not collect the data needed to produce telemetry based on SDK config. But as noted in #3917 and this comment, being able to check if Tracer / Meter / Logger is enabled is important. Let's add that in a followup. Supposing we do, then instrumentations will need to decide what their strategy is for checking if Tracer, Meter, Logger is enabled:
But this is a very useful feature even without the followup to add API surface area to check if Tracer / Meter / Logger is enabled. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
…#4063) Builds off #4020 to extend the `Enabled` API to `Tracer` and metrics `Instrument`. Adds language to Log SDK, Metrics SDK, and Trace SDK for how scope config is used to resolve the `Enabled` operation. This was discussed in #3867 but punted on in #3877 as [discussed here](#3877 (comment)). --------- Co-authored-by: Robert Pająk <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]> Co-authored-by: Reiley Yang <[email protected]>
…ry#3877) Fixes open-telemetry#3867. This introduces the concept of scope-level configuration for Tracer, Meter, and Logger. Notes: - TracerProvider, MeterProvider, and LoggerProvider have a scope config provider function, which accepts an `InstrumentationScope` and returns the relevant scope config. This function is invoked when a Tracer, Meter, Logger is created, and the resulting scope config dictates the behavior of resulting Tracers, Meters, Loggers. Computing the config on scope creation avoids doing extra work on the hot path. - If TracerProvider, MeterProvider, LoggerProvider supports updating configuration, the function can be updated, at which point the scope config of outstanding Tracer, Meter, Logger will be re-computed. This accommodates emerging dynamic config use cases. - A function as the mechanism to determine relevant scope config to maximize flexibility. However, implementations are encourages to provide syntactic sugar / helpers for accommodating popular use cases: select one or more scopes by name or with pattern matching, disable one or more selected scopes, disable all scopes by default and enable one or more selective scopes. - Scope config is simple at the moment, consisting of on the ability to enable / disable a particular Tracer, Meter, Logger. When a disabled, use the respective noop Tracer, Meter, Logger. - Scope config parameters are expected to evolve over time. When it makes sense, there should be consistency across signals. - Java prototype available for this proposal: open-telemetry/opentelemetry-java#6201 Leaving as a draft for now because its not ready to merge, but I am actively soliciting feedback. If / when we agree on direction, I'll go back and add the appropriate experimental indications.
…open-telemetry#4063) Builds off open-telemetry#4020 to extend the `Enabled` API to `Tracer` and metrics `Instrument`. Adds language to Log SDK, Metrics SDK, and Trace SDK for how scope config is used to resolve the `Enabled` operation. This was discussed in open-telemetry#3867 but punted on in open-telemetry#3877 as [discussed here](open-telemetry#3877 (comment)). --------- Co-authored-by: Robert Pająk <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]> Co-authored-by: Reiley Yang <[email protected]>
Fixes #3867.
This introduces the concept of scope-level configuration for Tracer, Meter, and Logger. Notes:
InstrumentationScope
and returns the relevant scope config. This function is invoked when a Tracer, Meter, Logger is created, and the resulting scope config dictates the behavior of resulting Tracers, Meters, Loggers. Computing the config on scope creation avoids doing extra work on the hot path.Leaving as a draft for now because its not ready to merge, but I am actively soliciting feedback. If / when we agree on direction, I'll go back and add the appropriate experimental indications.