2023-05-10 07:24:05 +00:00
|
|
|
package hscontrol
|
2021-10-04 16:28:07 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
|
|
)
|
|
|
|
|
|
|
|
const prometheusNamespace = "headscale"
|
|
|
|
|
|
|
|
var (
|
2023-01-17 16:43:44 +00:00
|
|
|
// This is a high cardinality metric (user x machines), we might want to make this
|
2021-10-04 16:28:07 +00:00
|
|
|
// configurable/opt-in in the future.
|
|
|
|
machineRegistrations = promauto.NewCounterVec(prometheus.CounterOpts{
|
|
|
|
Namespace: prometheusNamespace,
|
|
|
|
Name: "machine_registrations_total",
|
|
|
|
Help: "The total amount of registered machine attempts",
|
2023-01-17 16:43:44 +00:00
|
|
|
}, []string{"action", "auth", "status", "user"})
|
2021-10-04 16:28:07 +00:00
|
|
|
|
|
|
|
updateRequestsFromNode = promauto.NewCounterVec(prometheus.CounterOpts{
|
|
|
|
Namespace: prometheusNamespace,
|
|
|
|
Name: "update_request_from_node_total",
|
|
|
|
Help: "The number of updates requested by a node/update function",
|
2023-01-17 16:43:44 +00:00
|
|
|
}, []string{"user", "machine", "state"})
|
2021-10-05 21:59:15 +00:00
|
|
|
updateRequestsSentToNode = promauto.NewCounterVec(prometheus.CounterOpts{
|
2021-10-04 16:28:07 +00:00
|
|
|
Namespace: prometheusNamespace,
|
2021-10-05 21:59:15 +00:00
|
|
|
Name: "update_request_sent_to_node_total",
|
2021-10-04 16:28:07 +00:00
|
|
|
Help: "The number of calls/messages issued on a specific nodes update channel",
|
2023-01-17 16:43:44 +00:00
|
|
|
}, []string{"user", "machine", "status"})
|
2021-11-13 08:36:45 +00:00
|
|
|
// TODO(kradalby): This is very debugging, we might want to remove it.
|
2021-10-04 16:28:07 +00:00
|
|
|
)
|