Skip to content

[CONFIGURATION] feat: OTEL_METRICS_EXEMPLAR_FILTER env - #4328

Merged
ThomsonTan merged 17 commits into
open-telemetry:mainfrom
proost:feat-exemplar-filter-config
Aug 12, 2026
Merged

ThomsonTan merged 17 commits into
open-telemetry:mainfrom
proost:feat-exemplar-filter-config

Conversation

@proost

@proost proost commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

prev PR: #4267

Changes

Introduce "OTEL_METRICS_EXEMPLAR_FILTER". env is missing, so i add it.

I changed to use ctor instead of setter, Because i referred SpanLimit and breaking change is acceptable(due to preview).

According to spec, default is trace_based. But if performance downgrade worry, change to off is reasonable to me.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@proost
proost requested a review from a team as a code owner August 2, 2026 14:48
@codecov

codecov Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.49%. Comparing base (2d72ac7) to head (f6201d9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4328      +/-   ##
==========================================
+ Coverage   82.37%   82.49%   +0.12%     
==========================================
  Files         502      502              
  Lines       19883    19899      +16     
==========================================
+ Hits        16377    16414      +37     
+ Misses       3506     3485      -21     
Files with missing lines Coverage Δ
sdk/src/configuration/sdk_builder.cc 58.60% <100.00%> (+0.25%) ⬆️
sdk/src/metrics/meter_context.cc 93.82% <100.00%> (+1.05%) ⬆️
sdk/src/metrics/meter_context_factory.cc 100.00% <100.00%> (+81.25%) ⬆️
sdk/src/metrics/meter_provider_factory.cc 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

.Build())
#ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW
,
ExemplarFilterType exemplar_filter_type = ExemplarFilterType::kTraceBased

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.

Should this read OTEL_METRICS_EXEMPLAR_FILTER too? Right now, apps that create MeterContext or MeterProvider directly always get trace_based. The env setting only works through MeterContextFactory.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK, then how about calling as default argument? 7907e73

@lalitb

lalitb commented Aug 2, 2026

Copy link
Copy Markdown
Member

Please remove "Fixes #4178" from PR desc, as closing this Pr won't make the Exemplar to be declared stable.

@lalitb lalitb 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.

LGTM. Couple of comments, nothing blocking.

@dbarker dbarker added the pr:fix-merge-conflicts Please fix merge conflicts for this pr label Aug 8, 2026
@dbarker dbarker removed the pr:fix-merge-conflicts Please fix merge conflicts for this pr label Aug 9, 2026
@marcalff marcalff added the pr:fix-merge-conflicts Please fix merge conflicts for this pr label Aug 11, 2026
@proost proost changed the title feat: OTEL_METRICS_EXEMPLAR_FILTER env [CONFIGURATION] feat: OTEL_METRICS_EXEMPLAR_FILTER env Aug 11, 2026
@marcalff marcalff removed the pr:fix-merge-conflicts Please fix merge conflicts for this pr label Aug 11, 2026
@ThomsonTan
ThomsonTan merged commit 3893576 into open-telemetry:main Aug 12, 2026
73 checks passed
@proost
proost deleted the feat-exemplar-filter-config branch August 12, 2026 00:19
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.

5 participants