Skip to content

Histogram Explicit Bucket Boundaries issue #4428

Closed
@atibdialpad

Description

@atibdialpad

I am trying to use this #4361 feature and not being able to get the desired output.

a = meter.create_histogram('a_latency', explicit_bucket_boundaries_advisory=[0.0, 1.0, 2.0])
a.record(99.9)

I am having these metrics exported to an otel-collector (running the latest "Version": "0.119.0") and using the debug exporter to print the histogram where I see the default bucket boundaries are being used.

2025-02-13T17:35:14.529+0530	info	ResourceMetrics #0
Resource SchemaURL: 
Resource attributes:
     -> service.name: Str(log_to_metric)
ScopeMetrics #0
ScopeMetrics SchemaURL: 
InstrumentationScope otel_log_processor 
Metric #0
Descriptor:
     -> Name: a_latency
     -> Description: 
     -> Unit: 
     -> DataType: Histogram
     -> AggregationTemporality: Cumulative
HistogramDataPoints #0
StartTimestamp: 2025-02-13 12:04:45.590067 +0000 UTC
Timestamp: 2025-02-13 12:05:14.466452 +0000 UTC
Count: 1
Sum: 99.900000
Min: 99.900000
Max: 99.900000
ExplicitBounds #0: 0.000000
ExplicitBounds #1: 5.000000
ExplicitBounds #2: 10.000000
ExplicitBounds #3: 25.000000
ExplicitBounds #4: 50.000000
ExplicitBounds #5: 75.000000
ExplicitBounds #6: 100.000000
ExplicitBounds #7: 250.000000
ExplicitBounds #8: 500.000000
ExplicitBounds #9: 750.000000
ExplicitBounds #10: 1000.000000
ExplicitBounds #11: 2500.000000
ExplicitBounds #12: 5000.000000
ExplicitBounds #13: 7500.000000
ExplicitBounds #14: 10000.000000
Buckets #0, Count: 0
Buckets #1, Count: 0
Buckets #2, Count: 0
Buckets #3, Count: 0
Buckets #4, Count: 0
Buckets #5, Count: 0
Buckets #6, Count: 1
Buckets #7, Count: 0
Buckets #8, Count: 0
Buckets #9, Count: 0
Buckets #10, Count: 0
Buckets #11, Count: 0
Buckets #12, Count: 0
Buckets #13, Count: 0
Buckets #14, Count: 0
Buckets #15, Count: 0
	{"kind": "exporter", "data_type": "metrics", "name": "debug"}

client version

opentelemetry-api                        1.30.0
opentelemetry-exporter-otlp              1.30.0
opentelemetry-exporter-otlp-proto-common 1.30.0
opentelemetry-exporter-otlp-proto-grpc   1.30.0
opentelemetry-exporter-otlp-proto-http   1.30.0
opentelemetry-proto                      1.30.0
opentelemetry-sdk                        1.30.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions