Prometheus::Gauge
Inherits Prometheus::Metric / Reference / Object
A Gauge is a metric that represents a single numerical value that can arbitrarily go up and down.
Use a Gauge for metrics that can increase and decrease, such as:
- Current memory usage
- Number of items in a queue
- Number of active connections
Example:
gauge = Gauge.new("cpu_usage", "CPU usage percentage")
gauge.set(45.2) # Set to specific value
gauge.inc(5) # Increase by 5
gauge.dec(3) # Decrease by 3
Instance methods
type
Source