Skip to content

Commit 7841b6b

Browse files
committed
Add an example in docs
1 parent b0a61bc commit 7841b6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/examples/metrics/instruments/example.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,13 @@ def observable_gauge_func(options: CallbackOptions) -> Iterable[Observation]:
5858
histogram = meter.create_histogram("histogram")
5959
histogram.record(99.9)
6060

61+
62+
# Histogram with explicit_bucket_boundaries advisory
63+
histogram = meter.create_histogram(
64+
"histogram_with_advisory",
65+
advisory={"explicit_bucket_boundaries": [0, 1, 2]},
66+
)
67+
histogram.record(99.9)
68+
6169
# Async Gauge
6270
gauge = meter.create_observable_gauge("gauge", [observable_gauge_func])

0 commit comments

Comments
 (0)