Open osvaldopina opened 2 months ago
Please describe why you would need this.
In my use case I create the instrumenters, both the ones provided by otel instrumentation and the ones that we develped internally, and I would like to be able to enable or disable a specific Instrumenter at runtime.
hi @osvaldopina, is this to support dynamic configuration? e.g. https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/12251#issuecomment-2352404592
Hi @trask. Yes, that's the goal.
there's a broader effort happening that I think may address your use case, check out https://github.com/open-telemetry/opentelemetry-java/pull/6687 and https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/12251#issuecomment-2352404592
I took a look at the issues you pointed out. The 6687 has a broader effect of enabling or disabling all traces. I need something tied to each instrumenter allowing a much finer control. I saw 12251 and, as it is now, it is a list of intentions and my proposition could address one aspect of it. Looking at 6687 I realize that I can achieve what I need if the final clause is removed from the enabled attribute.
The 6687 has a broader effect of enabling or disabling all traces
it is per tracer (i.e. per instrumentation)
you can see more thoughts about 6687 in the spec work behind it: https://github.com/open-telemetry/opentelemetry-specification/issues/3867
Is your feature request related to a problem? Please describe.
Allows a fine grain control over span creation for a Instrumenter.
Describe the solution you'd like
...
private final Predicate<Instrumenter> enabled;
......
...
Or
...
private final Supplier<Boolean> enabled;
......
...
Describe alternatives you've considered
I could not find any other way to enable or disable Instrumenter span creation on th fly. If there is such a mecanism this feature request would not be necessary.
Additional context
No response