Crometheus::Sample
Inherits Struct / Value / Object
An instantaneous datum from a metric. Metric types
should yield one or more of these when Metric#sample is called.
Registry interpolates their values into an appropriate exposition
format.
Each Sample corresponds to one line item in the exposed metric data. Thus, counters and gauges always yield a single sample, while summaries and histograms yield more depending on how many buckets/quantiles are configured.
A Metric named :fruit that yields a Sample like this:
Sample.new(12.0, labels: {:species => "banana"}, suffix: "count")
will produce an exported metric line like this:
fruit_count{species="banana"} 12.0
Constructors
new(value : Float64, labels : Hash(Symbol, String) = {} of Symbol => String, suffix : String = "")
SourceInstance methods
labels
Sourcelabels=(labels : Hash(Symbol, String))
Sourcesuffix
Sourcesuffix=(suffix : String)
Sourcevalue
Sourcevalue=(value : Float64)
Source