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
#type
and#collect
methods
Metric implementations should be thread-safe and handle concurrent access appropriately.