headscale/hscontrol/metrics.go

26 lines
921 B
Go
Raw Normal View History

package hscontrol
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
const prometheusNamespace = "headscale"
var (
2023-09-24 19:42:05 +08:00
// This is a high cardinality metric (user x node), we might want to make this
// configurable/opt-in in the future.
2023-09-24 19:42:05 +08:00
nodeRegistrations = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: prometheusNamespace,
2023-09-24 19:42:05 +08:00
Name: "node_registrations_total",
Help: "The total amount of registered node attempts",
}, []string{"action", "auth", "status", "user"})
2021-10-06 05:59:15 +08:00
updateRequestsSentToNode = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: prometheusNamespace,
2021-10-06 05:59:15 +08:00
Name: "update_request_sent_to_node_total",
Help: "The number of calls/messages issued on a specific nodes update channel",
2023-09-24 19:42:05 +08:00
}, []string{"user", "node", "status"})
2021-11-13 16:36:45 +08:00
// TODO(kradalby): This is very debugging, we might want to remove it.
)