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

feat: allow disabling auto-instrumentations using env variable #1733

Conversation

maxkomarychev
Copy link

Rationale

While I am pretty happy with provided default instrumentations I would like to be able to disable some of them based on environment variables alone without getting into business of configuring integration manually

@maxkomarychev maxkomarychev requested a review from a team October 12, 2023 14:59
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 12, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: maxkomarychev / name: Max Komarychev (8907b2b)

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #1733 (2e680ce) into main (a8c225d) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

❗ Current head 2e680ce differs from pull request most recent head 8907b2b. Consider uploading reports for the commit 8907b2b to get more accurate results

@@            Coverage Diff             @@
##             main    #1733      +/-   ##
==========================================
- Coverage   91.72%   91.68%   -0.04%     
==========================================
  Files         139      139              
  Lines        7128     7131       +3     
  Branches     1433     1434       +1     
==========================================
  Hits         6538     6538              
- Misses        590      593       +3     
Files Coverage Δ
...ackages/auto-instrumentations-node/src/register.ts 0.00% <0.00%> (ø)

While I am pretty happy with provided default instrumentations I would like
to be able to disable some of them based on environment variables alone
without getting into business of configuring integration manually
@maxkomarychev maxkomarychev force-pushed the max/disable-autoinstrumentations branch from 2e680ce to 8907b2b Compare October 12, 2023 16:31
@@ -25,8 +25,17 @@ diag.setLogger(
opentelemetry.core.getEnv().OTEL_LOG_LEVEL
);

const disabledAutoinstrumentations = (
process.env.OTEL_DISABLED_AUTOINSTRUMENTATIONS ?? ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This environment variable is not speced. There is the OTEL_SDK_DISABLED environment variable from spec which I think might be what you are looking for.

However, I think OTEL should be disabled in the SDK level and not in the instrumentations level. Or are you interested in installing an SDK and only having auto instrumentations disabled while allowing manual instrumentation via trace/metrics/logs providers?

What distro are you currently using to instrument your code?

@blumamir
Copy link
Member

blumamir commented Nov 8, 2023

Hi @maxkomarychev

Please let us know if you are still interested in this feature, or if the PR can be closed. Thanks! 🙏

@maxkomarychev
Copy link
Author

@blumamir I'll close this for now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants