Skip to content

fix(sdk-node)!: fail-fast on MeterProvider creation from config file - #6954

Draft
trentm wants to merge 9 commits into
open-telemetry:mainfrom
trentm:trentm-sdk-create-from-config-4
Draft

fix(sdk-node)!: fail-fast on MeterProvider creation from config file#6954
trentm wants to merge 9 commits into
open-telemetry:mainfrom
trentm:trentm-sdk-create-from-config-4

Conversation

@trentm

@trentm trentm commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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: #6785
Refs: #6107 (comment)

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)
@trentm trentm self-assigned this Jul 28, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 28, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-07-28 22:09 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.39%. Comparing base (3f9756a) to head (0afaa5e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...s/opentelemetry-sdk-node/src/create-from-config.ts 66.26% 85 Missing ⚠️

❌ Your patch check has failed because the patch coverage (66.66%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6954      +/-   ##
==========================================
- Coverage   95.07%   94.39%   -0.69%     
==========================================
  Files         409      409              
  Lines       14256    14501     +245     
  Branches     3267     3363      +96     
==========================================
+ Hits        13554    13688     +134     
- Misses        702      813     +111     
Files with missing lines Coverage Δ
...ental/packages/opentelemetry-sdk-node/src/start.ts 96.87% <100.00%> (-0.16%) ⬇️
...ental/packages/opentelemetry-sdk-node/src/utils.ts 92.36% <ø> (-4.85%) ⬇️
...s/opentelemetry-sdk-node/src/create-from-config.ts 77.17% <66.26%> (-18.26%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

trentm added 5 commits July 28, 2026 10:17
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant