fullname
$fullname = $metric->fullname;
Returns the full name for the metric. This is formed by joining any of the defined values for
"namespace", "subsystem" and "name" with '_'.
labelcount
$labels = $metric->labelcount;
Returns the number of labels defined for this metric.
labels
$child = $metric->labels( @values );
$child = $metric->labels( { name => $value, name => $value, ... } );
Returns a child metric to represent the general one with the given set of labels. The label values may be
provided either in a list corresponding to the list of label names given at construction time, or by name
in a single HASH reference.
The child instance supports the same methods to control the value of the reported metric as the parent
metric object, except that any label values are already provided.
This object may be cached for efficiency.
make_sample
$sample = $metric->make_sample( $suffix, $labelkey, $value, $extralabels );
Returns a new "Sample" in Net::Prometheus::Types structure to represent the given value, by expanding the
opaque $labelkey value into its actual label names and values and appending the given suffix (which may
be an empty string) to the metric's fullname. If provided, the suffix will be separated by an underscore
'_'. If provided, $extralabels provides more label names and values to be added to the sample.
samples
@samples = $metric->samples;
An abstract method in this class, this method is intended to be overridden by subclasses.
Called during the value collection process, this method should return a list of "Sample" in
Net::Prometheus::Types instances containing the values to report from this metric.
remove
$metric->remove( @values );
$metric->remove( { name => $value, name => $value, ... } );
Sinceversion0.14.
Removes a single labelset from the metric. This stops it being reported by future calls to "samples".
clear
$metric->clear;
Sinceversion0.14.
Removes all the labelsets from the metric, resetting it back to an initial empty state.