Skip to content
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

suppress_instrumentation utils are not used consistently #2543

Closed
alexmojaki opened this issue May 22, 2024 · 1 comment · Fixed by #2590
Closed

suppress_instrumentation utils are not used consistently #2543

alexmojaki opened this issue May 22, 2024 · 1 comment · Fixed by #2590
Labels
bug Something isn't working

Comments

@alexmojaki
Copy link
Contributor

Searching for suppress_instrumentation (https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-python-contrib%20suppress_instrumentation&type=code) reveals places using the old plain string "suppress_instrumentation" context key, e.g:

Since this is not how instrumentation is actually suppressed any more, this can lead to bugs.

There are also places checking/setting the key 'manually' instead of via the utility functions, which also seems error-prone.

Additionally, if it's allowed for a user to have different versions of opentelemetry-instrumentation and opentelemetry-instrumentation-httpx (or another specific library instrumentation package) installed, then the util functions suppress_instrumentation and is_instrumentation_enabled should also check the plain string key "suppress_instrumentation" for backward compatibility.

@xrmx
Copy link
Contributor

xrmx commented May 29, 2024

Nice catch, a PR would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants