Counter metric, to track counts, running totals, or events.
If your use case can go up or down consider using a Gauge instead.
Use the rate() function in Prometheus to calculate the rate of increase of a Counter.
By convention, the names of Counters are suffixed by _total.
An Example Counter without Labels:
for {
cr <- CollectorRegistry.build[IO]
successCounter <- Counter.noLabels(cr, "example_success_total", "Example Counter of Success")
failureCounter <- Counter.noLabels(Cr, "example_failure_total", "Example Counter of Failure")
_ <- IO(println("Action Here")).guaranteeCase{
case ExitCase.Completed => successCounter.inc
case _ => failureCounter.inc
}
} yield ()
Counter metric, to track counts, running totals, or events.
If your use case can go up or down consider using a Gauge instead. Use the
rate()
function in Prometheus to calculate the rate of increase of a Counter. By convention, the names of Counters are suffixed by_total
.An Example Counter without Labels:
An Example of a Counter with Labels: