-
Notifications
You must be signed in to change notification settings - Fork 664
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
Make it possible to disable specific signals when using auto-instrumentation #4395
Comments
Ya this seems like an oversight. We actually already have entry points for the noop implementations that you should be able to specify: opentelemetry-python/opentelemetry-api/pyproject.toml Lines 45 to 46 in 58f2d16
not sure which warnings, but yes that might be appropriate. |
Yeah, I've seen the entry points. Will try to implement a fix in the coming week The warnings are all of this form:
|
The warning will be fixed in #4361 |
Won't touch the warnings in this PR then, thanks for the heads up @xrmx |
Finally got to work on this, and there’s an issue that I’m not sure how best to resolve. Using traces as an example, the current configuration process requires a narrower interface than the generic |
Is your feature request related to a problem?
I'll describe this in terms of disabling metrics, because that's the issue that vexes me the most, but this should be applicable to other signals as well
I use OpenTelemetry purely for tracing and I'd like as little as possible instrumentation code to run for other signals. This is both for performance reasons (though the impact is not that big) and because certain instrumentations can emit warnings related to the other signals, which I'd have to silence (a good example of that is the
aiohttp-server
instrumentation, which gets the same meters for each request, resulting in "meter already exists warnings").Describe the solution you'd like
opentelemetry-instrument
has the--meter_provider
arguments(and corresponding env var), which is ignored, as far as I can see (configuration code usesMeterProvider
unconditionally). These could accept thenone
value, and the auto-instrumentation code would react by selecting theNoOpMeterProvider
. As is, this wouldn't help with theaiohttp-server
issue described above, becauseNoOpMeter
still emits warnings, so I think it should also be changed, to emit no warnings.Describe alternatives you've considered
I don't think there are better alternatives, since it seems like some instrumentations (again
aiohttp-server
is an example) are implemented in a way where you can't choose which signals to instrument. So, to continue to work they should at least be able to get meters (and corresponding objects for other signals) and create metric objects. Which is why, I think, using the no-op versions of these objects, and having the no-op objects emit no warnings is the best we can doAdditional Context
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: