mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
mox!
This commit is contained in:
20
metrics/panic.go
Normal file
20
metrics/panic.go
Normal file
@ -0,0 +1,20 @@
|
||||
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()
|
||||
}
|
Reference in New Issue
Block a user