themis/gauge
Types
pub type GaugeError {
MetricError(metric.MetricError)
StoreError(store.StoreError)
LabelError(label.LabelError)
}
Constructors
-
MetricError(metric.MetricError)
-
StoreError(store.StoreError)
-
LabelError(label.LabelError)
Functions
pub fn new(
name name: String,
description description: String,
) -> Result(Nil, GaugeError)
Registers a new gauge metric to the store. Will return an error if the metric name is invalid or already used by another metric.
pub fn observe(
name name: String,
labels labels: Dict(String, String),
value value: Number,
) -> Result(Nil, GaugeError)
Sets a gauge value for the given metric name. Will return an error if the name is invalid, not a registered metric or not of the correct metric type. Will return an error if any of the labels have an invalid key. NaN, PosInf and NegInf values are valid but not recommended.