struct Crometheus::Sample
- Crometheus::Sample
- Struct
- Value
- Object
Overview
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
Defined in:
crometheus/sample.crConstructors
Instance Method Summary
- #labels : Hash(Symbol, String)
- #labels=(labels : Hash(Symbol, String))
- #suffix : String
- #suffix=(suffix : String)
- #value : Float64
- #value=(value : Float64)
Constructor Detail
def self.new(value : Float64, labels : Hash(Symbol, String) = {} of Symbol => String, suffix : String = "")
#