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 support otel sdk disabled env #3485

Merged

Conversation

RazGvili
Copy link
Contributor

@RazGvili RazGvili commented Dec 13, 2022

Which problem is this PR solving?

Support for the OTEL_SDK_DISABLED env variable.

Short description of the changes

In the case of a truthy value, the SDK functions(start, detectResources) that might create side effects are set to be no-op.
Parsing of boolean env variables.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • if SDK is disabled -> sdk.start should be a no-op. Should not register a trace/meter provider.
  • if SDK is disabled -> sdk.detectResources should be a no-op. Should not detect resources.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@RazGvili RazGvili requested a review from a team as a code owner December 13, 2022 14:39
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 13, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

Merging #3485 (d6b3836) into main (1c3af6c) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3485      +/-   ##
==========================================
+ Coverage   93.74%   93.77%   +0.02%     
==========================================
  Files         249      249              
  Lines        7593     7610      +17     
  Branches     1582     1587       +5     
==========================================
+ Hits         7118     7136      +18     
+ Misses        475      474       -1     
Impacted Files Coverage Δ
...imental/packages/opentelemetry-sdk-node/src/sdk.ts 93.54% <100.00%> (+0.52%) ⬆️
...ckages/opentelemetry-core/src/utils/environment.ts 92.30% <100.00%> (+1.39%) ⬆️
...-trace-base/src/platform/node/RandomIdGenerator.ts 93.75% <0.00%> (+6.25%) ⬆️

@blumamir
Copy link
Member

Might be useful to also document it in the README for the SDK package

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

Thank you for working on this! LGTM % nits.

@legendecas
Copy link
Member

Looks like there is a lint error. Would you mind fixing it? Thank you!

@legendecas legendecas merged commit eecb800 into open-telemetry:main Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants