class

Prometheus::Metric

Inherits Reference / Object

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.

Constructors

new(name : String, help : String, labels : Hash(String, String) = nil)
Source
new(name : String, help : String, labels : Prometheus::LabelSet = LabelSet.new)
Source

Instance methods

collect(io : IO) : Nil
Source
collect
Source
help
Source
labels
Source
name
Source
type
Source

Nested types