-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelemetry.go
More file actions
26 lines (21 loc) · 802 Bytes
/
telemetry.go
File metadata and controls
26 lines (21 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package authcontrol
import (
"github.com/go-chi/metrics"
)
var (
// Prometheus metrics.
requestsCounter = metrics.CounterWith[sessionLabels]("authcontrol_requests_total", "Total number of requests by session type.")
requestsServiceCounter = metrics.CounterWith[serviceLabels]("authcontrol_requests_service_total", "Total number of requests by S2S service.")
requestsProjectCounter = metrics.CounterWith[projectLabels]("authcontrol_requests_project_total", "Total number of requests by project ID.")
)
type sessionLabels struct {
SessionType string `label:"session_type"`
RateLimited string `label:"rate_limited"`
}
type serviceLabels struct {
Service string `label:"service"`
}
type projectLabels struct {
ProjectID string `label:"project_id"`
Status string `label:"status"`
}