Skip to content

feat(metrics): add OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION support#3433

Open
michaelbeaumont wants to merge 6 commits intoopen-telemetry:mainfrom
michaelbeaumont:feat/default-histogram-aggregation
Open

feat(metrics): add OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION support#3433
michaelbeaumont wants to merge 6 commits intoopen-telemetry:mainfrom
michaelbeaumont:feat/default-histogram-aggregation

Conversation

@michaelbeaumont
Copy link
Copy Markdown

@michaelbeaumont michaelbeaumont commented Mar 23, 2026

See #3374:

OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION — spec values are explicit_bucket_histogram, base2_exponential_bucket_histogram; no issue or PR

Changes

Add support for resolving OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION from the environment and threading it into exporters.

This adds a new method to the traits. If this is a problem it can certainly be replaced with a default implementation.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@michaelbeaumont michaelbeaumont force-pushed the feat/default-histogram-aggregation branch 2 times, most recently from 63d5007 to 0177db9 Compare March 31, 2026 10:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 72.25131% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.6%. Comparing base (f60125e) to head (0a50255).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-otlp/src/metric.rs 80.1% 22 Missing ⚠️
opentelemetry-sdk/src/metrics/pipeline.rs 59.2% 11 Missing ⚠️
opentelemetry-stdout/src/metrics/exporter.rs 0.0% 11 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/mod.rs 0.0% 6 Missing ⚠️
opentelemetry-sdk/src/metrics/exporter.rs 0.0% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3433     +/-   ##
=======================================
- Coverage   83.7%   83.6%   -0.1%     
=======================================
  Files        126     126             
  Lines      25386   25561    +175     
=======================================
+ Hits       21255   21380    +125     
- Misses      4131    4181     +50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@michaelbeaumont michaelbeaumont force-pushed the feat/default-histogram-aggregation branch from 0177db9 to 35d1bdc Compare April 9, 2026 11:08
@michaelbeaumont michaelbeaumont force-pushed the feat/default-histogram-aggregation branch from 35d1bdc to 8a440a4 Compare April 9, 2026 11:26
@michaelbeaumont michaelbeaumont marked this pull request as ready for review April 9, 2026 13:31
@michaelbeaumont michaelbeaumont requested a review from a team as a code owner April 9, 2026 13:31
fn temporality(&self) -> Temporality;

/// The default aggregation to use for histogram instruments.
fn default_histogram_aggregation(&self) -> HistogramAggregation;
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.

give default implementation, else this is a breaking change.

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