Skip to content

otel.sdk.exporter.operation.duration and otel.sdk.metric_reader.collection.duration omit explicit_bucket_boundaries_advisory=[] #5892

Open

Description

@dashpole

Description

otel.sdk.exporter.operation.duration and otel.sdk.metric_reader.collection.duration are created via create_otel_sdk_exporter_operation_duration and create_otel_sdk_metric_reader_collection_duration without explicit_bucket_boundaries_advisory=[]:

Per the SDK self-observability specification for otel.sdk.exporter.operation.duration and otel.sdk.metric_reader.collection.duration, both histograms SHOULD be specified with the ExplicitBucketBoundaries advisory parameter with a single bucket with no boundaries (explicit_bucket_boundaries_advisory=[]). Without this advisory, the SDK applies the default millisecond bucket boundaries ((0.0, 5.0, 10.0, ..., 10000.0)) to metrics measured in seconds (s).

Expected behavior

Both otel.sdk.exporter.operation.duration and otel.sdk.metric_reader.collection.duration should pass explicit_bucket_boundaries_advisory=[] to meter.create_histogram().

Activity

  1. ImamWahyudiz commented on Nov 6, 2026

    @ImamWahyudiz

    Hi @dashpole, I would like to work on this and add the explicit bucket boundaries advisory to the duration histograms.

  2. dashpole commented on Nov 6, 2026

    @dashpole
    ContributorAuthor

    Sounds good, feel free to open a PR! Note that opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/otel_metrics.py is generated from scripts/semconv/templates/registry/semantic_metrics.j2, so my suggestion would be to add an optional explicit_bucket_boundaries_advisory parameter to the histogram template (or call meter.create_histogram directly in _exporter_metrics.py and _metric_reader_metrics.py) rather than hand-editing otel_metrics.py.

  3. ImamWahyudiz commented on Nov 7, 2026

    @ImamWahyudiz

    Thanks for the pointer, @dashpole! I've opened PR #5895 and updated _exporter_metrics.py and _metric_reader_metrics.py to call meter.create_histogram directly with explicit_bucket_boundaries_advisory=[], keeping otel_metrics.py untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions