-
Notifications
You must be signed in to change notification settings - Fork 532
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
feat(auto-instrumentations-node): disabling instrumentations via env var #2174
feat(auto-instrumentations-node): disabling instrumentations via env var #2174
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2174 +/- ##
==========================================
- Coverage 90.97% 90.30% -0.68%
==========================================
Files 146 147 +1
Lines 7492 7260 -232
Branches 1502 1509 +7
==========================================
- Hits 6816 6556 -260
- Misses 676 704 +28
|
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.
I see that adding this env var was already commented in the linked PR here. I guess you already have the use case for this :)
I do keep getting the request for the simplest possible setup, and iterating from there. So this is similar to how many folks have gotten started with the |
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.
I strongly support this feature, which I find more usable than the enabled
list option.
The code changes looks good to me.
Thank you for working on this and adding this option
@open-telemetry/javascript-approvers Just wanted to ping to see if anyone else wanted a review before merging, since this is the auto-instr package so it is a bit more far-reaching than a single instrumentation. Otherwise will merge on Monday! |
I'm neutral on that feature. I'm usually a big proponent of people knowing which instrumentations are enabled, that's why I prefer explicitly enabling them - if we have enough that asked for this after we added the enabled env var then adding this should be okay. :) |
This is essential for an out of the box setup using the Kubernetes instrumentation CRD to auto-instrument existing services. We switched from using the datadog-agent to the opentelemetry-collector and the fs instrumentation overran our budget. I think it also adds parity to the other instrumentation libraries, e.g. OTEL_DOTNET_AUTO_METRICS_{0}_INSTRUMENTATION_ENABLED Most of the guides you'll find for the NodeSdk look like this:
By adding this environment variable, you can replicate this configuration using the opentelemetry-collector's injector without modifying existing services. |
Thanks for pushing through this change Jamie - where I work we were doing a lot of OpenTelemetry research earlier in the year and the whole "starting up an otel-instrumented hello world nodejs express app spits out 600 filesystem traces from module loading" thing was a big early problem I came across. I luckily also came across your example app repo that had the magic |
Which problem is this PR solving?
Short description of the changes
OTEL_NODE_DISABLED_INSTRUMENTATIONS
environment variable. This is similar to the use case when instrumenting in code usinggetNodeAutoInstrumentations()
where someone may want to start with every instrumentation and pare down from there.