feat: add support for `OTEL_SDK_DISABLED` environment variable
Fixes #1936
Changes
Add support for OTEL_SDK_DISABLED environment variable using no-op SDK implementation as explained Opentelemetry SDK environment variable docs. When set to true, the SDK will provide no-op implementations for all API components (Tracer, Logger, and Meter).
Implemented no-op provider classes that mimic the shutdown no-op providers for logger and tracer with only difference is shutdown variable which is set to false for disabled no op. Where as for metrics existing noop is re used
Merge requirement checklist
- [X] CONTRIBUTING guidelines followed
- [X] Unit tests added/updated (if applicable)
- [X] Appropriate
CHANGELOG.mdfiles updated for non-trivial, user-facing changes - [ ] Changes in public API reviewed (if applicable)
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: iamsauravsharma / name: Saurav Sharma (e2eb5fbf20fbc20f77be080d3af260a6f1d7ea0e)
Codecov Report
:x: Patch coverage is 28.03030% with 95 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 80.1%. Comparing base (2b63b75) to head (e2eb5fb).
Additional details and impacted files
@@ Coverage Diff @@
## main #3088 +/- ##
=======================================
- Coverage 80.5% 80.1% -0.4%
=======================================
Files 129 129
Lines 23294 23420 +126
=======================================
+ Hits 18756 18782 +26
- Misses 4538 4638 +100
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Since overwriting OTEL_SDK_DISABLED environment variable would effects other test when running parallel test. 3 new test are ignored by default and scripts/test.sh is updated so 3 test run themselves in last step
Implemented some changes as requested
@cijothomas @lalitb just a reminder about this PR. I’ve pushed the requested changes or replied with my reasoning. could you please take another look?