Repository navigation
fix(metrics): add explicit bucket boundaries advisory to duration histograms - #5895
ImamWahyudiz wants to merge 3 commits into
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-07 13:19 UTC Review the latest changes. Status above doesn't look right?
|
… bucket advisory and match PR 5895
|
I reviewed the changes across \exporter/opentelemetry-exporter-otlp-common\ and \opentelemetry-sdk, and checked the duration histogram behavior against the SDK self-observability specification. The fix is clean and aligns directly with the semantic conventions requirement for \otel.sdk.exporter.operation.duration\ and \otel.sdk.metric_reader.collection.duration. Both instruments record duration in seconds (\s), so omitting the explicit bucket advisory applied default millisecond buckets (0.0, 5.0, 10.0, ..., 10000.0). Passing \explicit_bucket_boundaries_advisory=[]\ ensures the histogram data points emit an empty boundary tuple ()\ unless overridden by a custom View. A few specific observations from checking the diff:
Solid fix and good catch on self-observability metric compliance. |
|
Thanks for the thorough review and suggestion, @knowprasad! I've updated est_proto_span_exporter.py in commit 1ef1b86 to assert metrics[0].data.data_points[0].explicit_bounds == (), providing the same end-to-end runtime data point verification for exporter duration metrics as well. |
Description
Fixes #5892
otel.sdk.exporter.operation.durationandotel.sdk.metric_reader.collection.durationwere created viacreate_otel_sdk_exporter_operation_durationandcreate_otel_sdk_metric_reader_collection_durationwithoutexplicit_bucket_boundaries_advisory=[].Per the SDK self-observability specification for otel.sdk.exporter.operation.duration and otel.sdk.metric_reader.collection.duration, both duration histograms measure in seconds (
s) and SHOULD be specified withexplicit_bucket_boundaries_advisory=[]to avoid applying default millisecond bucket boundaries (0.0, 5.0, 10.0, ...).This PR:
explicit_bucket_boundaries_advisory=[]increate_otel_sdk_exporter_operation_durationandcreate_otel_sdk_metric_reader_collection_duration.meter.create_histogram().().Type of change
Checklist:
tox -e precommittox -e typecheck