View Source prometheus_metric behaviour (prometheus v4.12.0)
Summary
Types
-type call_enabled() :: boolean().
-type counter_value() :: number().
-type duration_unit() :: prometheus_time:duration_unit().
-type gauge_value() :: number().
-type help() :: binary() | nonempty_string().
-type labels() :: [name()].
-type name() :: atom() | binary() | nonempty_string() | iolist().
-type spec() :: proplists:proplist().
-type value() :: counter_value() | gauge_value() | summary_value() | histogram_value() | undefined.
Callbacks
-callback new(Spec :: spec()) -> ok.
-callback remove(Registry, Name, LValues) -> boolean() | no_return() when Registry :: prometheus_registry:registry(), Name :: name(), LValues :: list().
-callback reset(Registry, Name, LValues) -> boolean() | no_return() when Registry :: prometheus_registry:registry(), Name :: name(), LValues :: list().
-callback set_default(Registry, Name) -> any() when Registry :: prometheus_registry:registry(), Name :: name().
-callback value(Registry, Name, LValues) -> value() | no_return() when Registry :: prometheus_registry:registry(), Name :: name(), LValues :: list().