fix(sdk-node)!: fail-fast on MeterProvider creation from config file - #6954
fix(sdk-node)!: fail-fast on MeterProvider creation from config file#6954trentm wants to merge 13 commits into
Conversation
This refactors the MeterProvider creation from declarative config in the `startNodeSDK()` code path: - fail-fast (and fallback to a no-op SDK) if the config has unknown values or values that aren't yet supported by the SDK - fixes a number of missed cases - adds a number of TODO for meter_provider config cases to follow-up on (Some of these are to keep this PR smaller, some are because sdk-metrics doesn't yet support everything the declarative config schema supports configuring.) Refs: open-telemetry#6785 Refs: open-telemetry#6107 (comment)
Pull request dashboard statusWaiting on reviewers · refreshed 2026-07-30 17:29 UTC Review the latest changes. Status above doesn't look right?
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6954 +/- ##
==========================================
- Coverage 95.07% 94.97% -0.11%
==========================================
Files 409 409
Lines 14256 14328 +72
Branches 3267 3292 +25
==========================================
+ Hits 13554 13608 +54
- Misses 702 720 +18
🚀 New features to boost your workflow:
|
Also limit reading of TLS files to *absolute paths* as required by the declarative config. Note: that doesn't work properly for the 'build-config-from-env-vars' code path. Update to have real TLS files with the usual maint:... npm script. Real TLS files are required by createSslCredentials(), which was being masked before by the just-warn semantics.
…h handles negative, and fails-fast
There was a problem hiding this comment.
The files and regenerate.sh script in this dir are the exact same setup we use for testable TLS files in the otlp-exporter-base and otlp-grpc-exporter-base packages.
…d unused utils.ts code and tests
|
Before/after comparison of test coverage for the 'sdk-node' package. Before: After:
|
There was a problem hiding this comment.
Reviewer note: Sorry, I know reviewing this file will be tedious. I both moved and improved functionality that was in "utils.ts". For example getMeterViewsFromConfiguration() became createViewOptionsFromConfig() in this file.
| cert_file: /app/cert.pem | ||
| ca_file: ${TEST_DIR}/certs/ca.crt | ||
| key_file: ${TEST_DIR}/certs/client.key | ||
| cert_file: ${TEST_DIR}/certs/client.crt |
There was a problem hiding this comment.
Reviewer note: We are now strictly requiring that TLS files exist.
This refactors the MeterProvider creation from declarative config
in the
startNodeSDK()code path:values or values that aren't yet supported by the SDK
(Some of these are to keep this PR smaller, some are because
sdk-metrics doesn't yet support everything the declarative config
schema supports configuring.)
Refs: #6785
Refs: #6107 (comment)