struct
Prometheus::LabelSet
- Prometheus::LabelSet
- Struct
- Value
- Object
Overview
LabelSet represents a collection of labels that uniquely identify a metric.
A LabelSet is used to attach multiple labels to a metric, enabling Prometheus's dimensional data model.
labels = LabelSet.new({
"method" => "GET",
"path" => "/api/users",
})
LabelSets can be merged to combine labels from different sources:
base_labels = LabelSet.new({"service" => "web"})
request_labels = LabelSet.new({"method" => "GET"})
combined = base_labels.merge(request_labels)
Included Modules
- Enumerable({String, String})
Defined in:
types.crConstructors
Instance Method Summary
- #==(other : self)
- #[]?(label : String)
- #add(name : String, value : String)
- #each(*args, **options)
- #each(*args, **options, &)
-
#hash(hasher)
See
Object#hash(hasher) - #labels : Hash(String, String)
- #merge(other : LabelSet)
- #merge(other : Hash(String, String))
-
#to_s(io : IO)
Same as
#inspect(io).