From 7841b6b96454bbe2d4d130f487a0135ea47f780b Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 23 Dec 2024 16:58:38 +0100 Subject: [PATCH] Add an example in docs --- docs/examples/metrics/instruments/example.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/examples/metrics/instruments/example.py b/docs/examples/metrics/instruments/example.py index fde20308a21..f2c86bbd60a 100644 --- a/docs/examples/metrics/instruments/example.py +++ b/docs/examples/metrics/instruments/example.py @@ -58,5 +58,13 @@ def observable_gauge_func(options: CallbackOptions) -> Iterable[Observation]: histogram = meter.create_histogram("histogram") histogram.record(99.9) + +# Histogram with explicit_bucket_boundaries advisory +histogram = meter.create_histogram( + "histogram_with_advisory", + advisory={"explicit_bucket_boundaries": [0, 1, 2]}, +) +histogram.record(99.9) + # Async Gauge gauge = meter.create_observable_gauge("gauge", [observable_gauge_func])