prometheus_http (prometheus v5.1.1)

View Source

HTTP instrumentation helpers

Summary

Functions

Returns default microseconds buckets for measuring http requests duration.

Returns status class for the http status code SCode.

Types

status_class()

-type status_class() :: prometheus:label_value().

status_code()

-type status_code() :: pos_integer().

Functions

microseconds_duration_buckets()

-spec microseconds_duration_buckets() -> prometheus_buckets:buckets().

Returns default microseconds buckets for measuring http requests duration.

1> prometheus_http:microseconds_duration_buckets().
[10, 25, 50, 100, 250, 500,
 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000,
 1000000, 2500000, 5000000, 10000000]

status_class(SCode)

-spec status_class(SCode) -> StatusClass when SCode :: status_code(), StatusClass :: status_class().

Returns status class for the http status code SCode.

2> prometheus_http:status_class(202).
\"success\"

Raises {invalid_value_error, SCode, Message} error if SCode isn't a positive integer.