Skip to content

docs(configuration): add declarative config example for startNodeSDK()#6834

Open
MikeGoldsmith wants to merge 7 commits into
open-telemetry:mainfrom
MikeGoldsmith:mike/6807-declarative-config-example
Open

docs(configuration): add declarative config example for startNodeSDK()#6834
MikeGoldsmith wants to merge 7 commits into
open-telemetry:mainfrom
MikeGoldsmith:mike/6807-declarative-config-example

Conversation

@MikeGoldsmith

Copy link
Copy Markdown
Member

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 via OTEL_CONFIG_FILE. Users and vendors looking to adopt declarative config have no runnable starting point.

Fixes #6807.

Short description of the changes

Type of change

  • This change requires a documentation update

How Has This Been Tested?

  • npm install + npm start against the bundled collector emits one span, one metric data point, and one log record visible via docker compose logs -f otel-collector. Verified locally:
    • Span: example.request with service.name=declarative-config-example
    • Metric: example.requests counter
    • Log: Handled example request, correlated to the span
  • tsc --noEmit and markdownlint-cli2 clean against the new files.

Checklist:

  • Followed the style guidelines of this project
  • Documentation has been updated

- 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
@MikeGoldsmith
MikeGoldsmith requested a review from a team as a code owner June 19, 2026 14:52
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.08%. Comparing base (27cd33a) to head (d1c2c5b).

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:
  • ❄️ 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.

@maryliag maryliag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great example! Thank you for adding!

Comment thread package-lock.json
Comment thread experimental/examples/declarative-config/index.ts Outdated
Comment thread experimental/examples/declarative-config/otel-config.yaml Outdated
Comment thread experimental/examples/declarative-config/README.md Outdated
…ve-config-example

# Conflicts:
#	experimental/packages/configuration/README.md
- 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)
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jun 30, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-25 18:37:44 UTC.

  • Waiting on: Maintainers
  • Next step: Merge when ready.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected.

@MikeGoldsmith

Copy link
Copy Markdown
Member Author

@maryliag @trentm I think this is ready for another round of reviews 👍🏻

@trentm trentm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A number of nits, but looks good to me (along with a proposal to have a separate "telemetry.ts").

Comment thread experimental/examples/declarative-config/README.md Outdated
Comment thread experimental/examples/declarative-config/docker-compose.yaml Outdated
Comment thread experimental/examples/declarative-config/otel-config.yaml Outdated
Comment thread experimental/examples/declarative-config/otel-config.yaml Outdated
Comment thread experimental/examples/declarative-config/otel-config.yaml Outdated
Comment thread experimental/examples/declarative-config/otel-config.yaml Outdated
Comment thread experimental/examples/declarative-config/otel-config.yaml Outdated
Comment thread experimental/examples/declarative-config/package.json Outdated
Comment thread experimental/examples/declarative-config/index.ts
@MikeGoldsmith

Copy link
Copy Markdown
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!

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.

docs(configuration): add a declarative config example (YAML + README) for startNodeSDK()

3 participants