Crometheus::Metric::LabeledMetric(LabelType, MetricType)
Inherits Crometheus::Metric / Reference / Object
LabeledMetric is a generic type that acts as a collection of
Metric objects exported under the same metric name, but with
different labelsets.
It takes two type parameters, one for the type of Metric to
to collect, and one NamedTuple mapping label names to String
values.
Since this is cumbersome to type out, you generally won't refer to
LabeledMetric directly in your code; instead, use Metric.[] or
Crometheus.alias to generate an appropriate LabeledMetric
type.
Storing labelsets as NamedTuples allows the compiler to enforce
the constraint that every metric in the collection have the same
set of label names.
Constructors
Creates a LabeledMetric, saving **metric_params for passage
to the constructors of each metric in the collection.
Class methods
Instance methods
Fetches the metric with the given labelset. Takes one keyword argument for each of this metric's labels.
Deletes the metric with the given labelset from the collection. Takes one keyword argument for each of this metric's labels.
Iteratively calls samples on each metric in the collection,
yielding each received Sample.
See Metric#samples.