docs(configuration): add declarative config example for startNodeSDK()#6834
Open
MikeGoldsmith wants to merge 7 commits into
Open
docs(configuration): add declarative config example for startNodeSDK()#6834MikeGoldsmith wants to merge 7 commits into
MikeGoldsmith wants to merge 7 commits into
Conversation
- new runnable example under experimental/examples/declarative-config covering traces, metrics, and logs over OTLP HTTP with env var substitution and a parent_based sampler config (parsed; applied once open-telemetry#6506 lands) - bundled otel collector via docker-compose so the example runs end-to-end out of the box - expand configuration package README with supported fields, current limitations, and the new schema version (1.1) Closes open-telemetry#6807
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6834 +/- ##
=======================================
Coverage 95.08% 95.08%
=======================================
Files 394 394
Lines 13997 13997
Branches 3224 3224
=======================================
Hits 13309 13309
Misses 688 688 🚀 New features to boost your workflow:
|
maryliag
reviewed
Jun 19, 2026
maryliag
left a comment
Member
There was a problem hiding this comment.
Great example! Thank you for adding!
…ve-config-example # Conflicts: # experimental/packages/configuration/README.md
This was referenced Jun 24, 2026
…ve-config-example
- index.ts: drop the 1s setTimeout before shutdown; shutdown already flushes - otel-config.yaml: reword the propagator comment so readers don't assume the spec defaults are auto-applied without the block - README.md: use vendor-neutral OTEL_EXPORTER_OTLP_ENDPOINT placeholder - configuration README: drop the now-obsolete Supported fields / Current limitations tables (the upstream pointer added by open-telemetry#6846 is the source of truth) - CHANGELOG entry trimmed to just the example, since the README docs bullet now lives under open-telemetry#6846's entry on main - package-lock.json: add only the new workspace entry, not lockfile housekeeping unrelated to this PR (open-telemetry#6834 review nit)
Pull request dashboard statusStatus last refreshed: 2026-07-25 18:37:44 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
Member
Author
maryliag
approved these changes
Jul 7, 2026
trentm
reviewed
Jul 9, 2026
trentm
left a comment
Contributor
There was a problem hiding this comment.
A number of nits, but looks good to me (along with a proposal to have a separate "telemetry.ts").
Member
Author
|
@trentm I worked through your feedback and did as much as I could. Let me know if there's anything I missed, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
There is no end-to-end example in the repo showing how to drive
startNodeSDK()from a YAML file viaOTEL_CONFIG_FILE. Users and vendors looking to adopt declarative config have no runnable starting point.Fixes #6807.
Short description of the changes
experimental/examples/declarative-config/:otel-config.yamlcovering traces, metrics, and logs over OTLP HTTP, resource attributes, propagators, env var substitution (endpoint + headers), and aparent_basedsampler. Sampler is parsed today and will start sampling once add trace sampler from config #6506 lands.index.tscallsstartNodeSDK()and emits one span, one counter increment, and one log record.docker-compose.yaml+otel-collector-config.yamlship a local collector with thedebugexporter so the example runs out of the box; instructions for pointing at any other OTLP endpoint are in the README.experimental/packages/configuration/README.mdgains a Supported fields table and a Current limitations table linking to the relevant tracking issues (add trace sampler from config #6506, add config for prometheus exporter #6063, create PullExportingMetricReader #6426, add warning for invalid values #6107, The Create operation calls CreatePlugin of corresponding ComponentProvider when encountering extension components #5824, Register a ComponentProvider #5825), and bumps Supported schema versions to1.1(landed in feat(configuration): bump config schema to v1.1.0, apply Prometheus property rename #6781).experimental/examples/README.mdand a changelog entry.Type of change
How Has This Been Tested?
npm install+npm startagainst the bundled collector emits one span, one metric data point, and one log record visible viadocker compose logs -f otel-collector. Verified locally:example.requestwithservice.name=declarative-config-exampleexample.requestscounterHandled example request, correlated to the spantsc --noEmitandmarkdownlint-cli2clean against the new files.Checklist: