mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
20 lines
384 B
Go
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()
|
|
}
|