open-telemetry / open-telemetry/opentelemetry-ruby
Read `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION`
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
Spec requirement
The OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION env var (explicit_bucket_histogram/base2_exponential_bucket_histogram, default explicit_bucket_histogram) SHOULD be supported (sdk_exporters/otlp.md:43-70).
Current behavior
The default (ExplicitBucketHistogram, instrument/histogram.rb (permalink) default aggregation) is correct, but the env var itself is never read in exporter/otlp-metrics or metrics_sdk. A user can't switch the default to exponential histograms via configuration, only by explicitly registering a View.
Suggested fix
Read OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION in the OTLP exporter or metrics_sdk configurator, and use it to select the default histogram aggregation when no View overrides it.
Related rows in SPEC_COMPLIANCE_METRICS.md
OTLP-3
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 reading metrics_sdk/instrument/histogram.rb and the OTLP exporter or metrics_sdk configurator under exporter/otlp-metrics and metrics_sdk. Trace how the default ExplicitBucketHistogram aggregation is selected and how a View overrides it. Done means the environment variable selects explicit or base-2 exponential aggregation when no View overrides it, while the existing default remains explicit_bucket_histogram.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 76/100