View Source prometheus_buckets (prometheus v4.12.0)

Summary

Functions

Default histogram buckets.

Histogram buckets constructor, returns default/0 plus infinity

Histogram buckets constructor

Types

bucket_bound()

-type bucket_bound() :: number() | infinity.

buckets()

-type buckets() :: [bucket_bound(), ...].

config()

-type config() ::
          undefined | default |
          {linear, number(), number(), pos_integer()} |
          {exponential, number(), number(), pos_integer()} |
          buckets().

Functions

default()

-spec default() -> buckets().

Default histogram buckets.

1> prometheus_buckets:default().
[0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]

Please note these buckets are floats and represent seconds so you'll have to use prometheus_histogramdobserve/3 or configure duration_unit as seconds.

new()

-spec new() -> buckets().

Histogram buckets constructor, returns default/0 plus infinity

new/1

-spec new(config()) -> buckets().

Histogram buckets constructor

position(Buckets, Value)

-spec position(buckets(), number()) -> pos_integer().