open-telemetry / open-telemetry/opentelemetry-php
`OTEL_METRICS_EXEMPLAR_FILTER` does not accept the specification values
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 912
- Forks
- 232
- Avg merge
- 7d 16h
- Merged PRs (30d)
- 4
Description
MeterProviderFactory::createExemplarFilter() matches all, with_sampled_trace, none instead of the specification's always_on, trace_based, always_off. A spec-compliant value hits the default branch, logs "Unknown exemplar filter", and silently results in no exemplars being captured.
Steps to reproduce
OTEL_PHP_AUTOLOAD_ENABLED=true
OTEL_METRICS_EXEMPLAR_FILTER=always_on
Globals::meterProvider()
->getMeter('test')
->createCounter('no-span.counter')
->add(1);
What is the expected behavior?
Metric contains exemplar.
What is the actual behavior?
Metric does not contain exemplar.
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating MeterProviderFactory::createExemplarFilter() and inspect how OTEL_METRICS_EXEMPLAR_FILTER is matched. Reproduce with OTEL_PHP_AUTOLOAD_ENABLED=true and OTEL_METRICS_EXEMPLAR_FILTER=always_on, then verify that the specification values select the intended filters and the metric contains an exemplar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100