abstract class
Prometheus::Metric
- Prometheus::Metric
- Reference
- Object
Overview
Base class for all metric types (Counter, Gauge, Histogram, Summary).
This abstract class defines the common interface and behavior for all metrics:
- Each metric has a name, help text, and optional labels
- Names must match the regex
[a-zA-Z_:][a-zA-Z0-9_:]* - Each metric type must implement
#typeand#collectmethods
Metric implementations should be thread-safe and handle concurrent access appropriately.
Direct Known Subclasses
Defined in:
types.crConstructors
- .new(name : String, help : String, labels : Hash(String, String) = nil)
- .new(name : String, help : String, labels : Prometheus::LabelSet = LabelSet.new)
Instance Method Summary
- #collect(io : IO) : Nil
- #collect : Array(Sample)
- #help : String
- #labels : LabelSet
- #name : String
- #type : String