Prometheus::Counter
Inherits Prometheus::Metric / Reference / Object
A Counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero.
Use a Counter for metrics that accumulate values, such as:
- Number of requests served
- Number of tasks completed
- Number of errors
Example:
counter = Counter.new("http_requests_total", "Total HTTP requests")
counter.inc # Increment by 1
counter.inc(5) # Increment by 5
NOTE: Counter values cannot decrease. Use a Gauge for values that can go up and down.
Instance methods
type
Source