Skip to content

feat(config): add declarative configuration for meter_provider - #2464

Open
mwear wants to merge 5 commits into
open-telemetry:mainfrom
mwear:config-meter-provider
Open

mwear wants to merge 5 commits into
open-telemetry:mainfrom
mwear:config-meter-provider

Conversation

@mwear

@mwear mwear commented Oct 15, 2026

Copy link
Copy Markdown
Member

Description

Related to #2127

This adds meter_provider support to opentelemetry-config. This might be a little early as work for some of the options is still under way in the SDK.

Like logs in #2439, the metrics gems are soft dependencies, and only configured values are passed to the SDK. Omitted settings fall back to SDK defaults.

The SDK drops data for views without an aggregation, so config resolves a view's default aggregation from selector.instrument_type, and skips views that don't set one.

Some settings aren't supported by the SDK yet. They're skipped with a warning, and several have open PRs:

I'll wire these up as the SDK support lands.

Changes

  • Build an SDK MeterProvider from meter_provider, with periodic readers, console and otlp_http exporters, views, and exemplar_filter
  • Config.install registers the meter provider as OpenTelemetry.meter_provider, upgrading the default proxy, and attaches fork hooks so periodic readers restart in forked processes
  • Treat the metrics SDK and OTLP metrics exporter as optional, skipping with a warning when they aren't loaded
  • Docs

Authorship

  • I, a human, wrote this pull request description myself.

@mwear mwear changed the title feat(config): add declarative configuration for logger_provider feat(config): add declarative configuration for meter_provider Oct 15, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants