mox/metrics/panic.go
Mechiel Lukkien cb229cb6cf
mox!
2023-01-30 14:27:06 +01:00

20 lines
384 B
Go

package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var metricPanic = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "mox_panic_total",
Help: "Number of unhandled panics, by package.",
},
[]string{
"pkg",
},
)
func PanicInc(pkg string) {
metricPanic.WithLabelValues(pkg).Inc()
}