struct

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 = "")
Source

Instance methods

labels
Source
labels=(labels : Hash(Symbol, String))
Source
suffix
Source
suffix=(suffix : String)
Source
value
Source
value=(value : Float64)
Source