Skip to content

Commit

Permalink
Add an example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Dec 23, 2024
1 parent b0a61bc commit 7841b6b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/examples/metrics/instruments/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

0 comments on commit 7841b6b

Please sign in to comment.