Skip to content

[METRICS SDK] Validate Base2 Exponential Histogram Aggregation config#4253

Draft
RaviTriv wants to merge 6 commits into
open-telemetry:mainfrom
RaviTriv:ravtrive/base2-histogram-config-validation
Draft

[METRICS SDK] Validate Base2 Exponential Histogram Aggregation config#4253
RaviTriv wants to merge 6 commits into
open-telemetry:mainfrom
RaviTriv:ravtrive/base2-histogram-config-validation

Conversation

@RaviTriv

@RaviTriv RaviTriv commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #4250

Changes

Validates the Base2 Exponential Histogram Aggregation parameters to align with the OTEL configuration spec.

Naming and Types

  • Updated Base2ExponentialHistogramAggregationConfig::max_buckets_ to max_size_
  • Set Base2ExponentialBucketHistogramAggregationConfiguration::max_scale type to int32
    • Added DocumentNode::GetSignedInteger to handle negative values

Validation

  • Throw InvalidSchemaException if config value is out of range.
  • Log warning and set to default value.
  • Updated defaults to align with the spec.

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

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.41667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.17%. Comparing base (c4af827) to head (9c689b9).

Files with missing lines Patch % Lines
sdk/src/configuration/document_node.cc 63.64% 4 Missing ⚠️
sdk/src/configuration/sdk_builder.cc 0.00% 2 Missing ⚠️
sdk/src/configuration/ryml_document_node.cc 90.91% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4253      +/-   ##
==========================================
+ Coverage   78.15%   78.17%   +0.03%     
==========================================
  Files         440      440              
  Lines       18741    18781      +40     
==========================================
+ Hits        14645    14681      +36     
- Misses       4096     4100       +4     
Files with missing lines Coverage Δ
...ntial_bucket_histogram_aggregation_configuration.h 0.00% <ø> (ø)
...de/opentelemetry/sdk/configuration/document_node.h 100.00% <ø> (ø)
...entelemetry/sdk/configuration/ryml_document_node.h 100.00% <ø> (ø)
...metry/sdk/metrics/aggregation/aggregation_config.h 100.00% <ø> (ø)
...entelemetry/sdk/metrics/exemplar/reservoir_utils.h 100.00% <100.00%> (ø)
sdk/src/configuration/configuration_parser.cc 78.30% <100.00%> (+0.24%) ⬆️
...egation/base2_exponential_histogram_aggregation.cc 96.74% <100.00%> (+0.12%) ⬆️
sdk/src/configuration/ryml_document_node.cc 80.40% <90.91%> (+0.49%) ⬆️
sdk/src/configuration/sdk_builder.cc 5.00% <0.00%> (ø)
sdk/src/configuration/document_node.cc 77.85% <63.64%> (-1.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RaviTriv RaviTriv force-pushed the ravtrive/base2-histogram-config-validation branch from e193ae0 to 9c689b9 Compare July 16, 2026 10:56
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.

Base2ExponentialHistogramAggregation configuration validation

1 participant