Closed fnmut closed 1 month ago
Figured it out, the solution is to set a MeterProvider with a View
that handles the histogram, eg:
meter_provider = MeterProvider(
metric_readers=[reader],
views=[
View(
instrument_type=metrics.Histogram,
instrument_name=histogram_name,
aggregation=ExplicitBucketHistogramAggregation(
boundaries=[
0,
10,
50,
100,
200,
400,
600,
800,
1000,
2000,
10000,
]
),
)
],
)
metrics.set_meter_provider(meter_provider)
version 1.23.0 of
opentelemetry-sdk
python 3.12I see
OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION
, which I think defaults toExplicitBucketHistogramAggregation
? How can I set the boundaries on this? During setup of the MeterProvider?Apologies if this is the wrong place to ask this question.
edit: I found this issue and it seems like I should add it as a
View
in theMeterProvider
?