Skip to content

fix(sdk): don't crash on invalid OTEL_METRICS_EXEMPLAR_FILTER - #5954

Open
bishalde wants to merge 2 commits into
open-telemetry:mainfrom
bishalde:fix/exemplar-filter-env-parsing
Open

bishalde wants to merge 2 commits into
open-telemetry:mainfrom
bishalde:fix/exemplar-filter-env-parsing

Conversation

@bishalde

@bishalde bishalde commented Nov 22, 2026 •

Copy link
Copy Markdown

Fixes #5948

MeterProvider() no longer raises on a bad OTEL_METRICS_EXEMPLAR_FILTER:

  • strip surrounding spaces, treat empty as unset
  • match case-insensitively (spec: enum values SHOULD be case-insensitive)
  • unknown value logs a warning and falls back to trace_based

Added tests for each case. Happy to drop the case-insensitive part if preferred, see discussion in #5948.

Read the value case-insensitively and ignore surrounding spaces.
Treat an empty value as unset, and warn and fall back to
trace_based on an unknown value instead of raising from
MeterProvider().

Assisted-by: Claude Opus 5.5
@bishalde
bishalde requested a review from a team as a code owner November 22, 2026 04:15
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on maintainers · refreshed 2026-11-23 13:49 UTC

Merge when ready.

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.

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Nov 23, 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

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

MeterProvider raises ValueError on empty or uppercase OTEL_METRICS_EXEMPLAR_FILTER

2 participants