-
Notifications
You must be signed in to change notification settings - Fork 533
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
NodeJS auto-instrumentation: Allow disabling specific instrumentations with environment variables #1672
Comments
Alright, we just confirmed that disabling the OTEL instrumentation no longer produces the error described above. Should I create a separate issue for that as it's likely a redis issue? |
I second this. It's really annoying having to implement manual configuration file for tracing just to disable/enable single instrumentation. Implementation for this should not be complex at all, as @FredrikAugust mentioned, it's already done for resource detectors. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
I don't think this would be a lot of work, and would allow people to control what instrumentations are being used so I would love to see this implemented! |
Can we please get this in? |
My use-caseI need this feature, because I can't disable the integrations from the code and application startup is a lot slower with all integrations enabled (specially if CPU is limited). I can't disable from code, because I'm using k8s opentelemetry operator, that loads all instrumentations, so applications that use it can't customize it. Alternative solutionsOne option for me would be to solve the issue in opentelemetry-operator, but i think it would be bad idea:
My preferred solutionI'd prefer it if this library also supported disabling instrumentations via environment variables (currently it only supports disabling via inputConfigs object passed to getNodeAutoInstrumentations function). Let's get ready for the PR - environment variable naming conventionsIf we could agree upon a naming convention, i could send a PR to implement it. For example @TylerHelmuth mentioned that Java, Python and .Net all use environment variables for that purpose, but their naming conventions are different. Single environment variable like used for configuring node resource detectorsOne option would be to have single variable that lists enabled instrumentations (like configuring resource detectors via OTEL_NODE_RESOURCE_DETECTORS):
Separate environment variables, like used in Java, Python and .Net SDKs
where
Then it would be possible to derive the name of the environment variable to check based on name of the package to enable/disable. Related issues:
|
@atsu85 That is quite a coincidence because I have started looking into adding this feature a few days ago and have started with the implementation today. |
FYI: i added auto-instrumentation slowness investigation results summary to my PR - perhaps someone stumbling upon this issue might find it useful as well to understand the startup slowness better |
Describe the solution you'd like to see
We would like to keep all instrumentations active except for
redis-4
. This is something that is possible with the Java SDK, but currently not with the JavaScript SDK, using theOTEL_INSTRUMENTATION_[NAME]_ENABLED
environment variables.Something like this is possible for the resource detectors so a solution akin to that would be amazing.
Describe alternatives you've considered
As we're using the Kubernetes OTEL Agent Operator we are AFAIK limited to environment variables in terms of configuration of the autoinstrumentation so the only other solution I've thought of is disabling the instrumentation all-together.
Additional context
I'll happily contribute to this if you'd like:)
The text was updated successfully, but these errors were encountered: