forked from openkruise/agents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics.go
More file actions
40 lines (35 loc) · 1.2 KB
/
metrics.go
File metadata and controls
40 lines (35 loc) · 1.2 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package sandboxset
import (
"github.com/prometheus/client_golang/prometheus"
"sigs.k8s.io/controller-runtime/pkg/metrics"
)
var (
// SandboxSetReplicas tracks the total number of replicas in each SandboxSet
SandboxSetReplicas = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "sandboxset_replicas",
Help: "Current number of replicas in the SandboxSet",
},
[]string{"namespace", "name"},
)
// SandboxSetAvailableReplicas tracks the number of available replicas in each SandboxSet
SandboxSetAvailableReplicas = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "sandboxset_available_replicas",
Help: "Current number of available replicas in the SandboxSet",
},
[]string{"namespace", "name"},
)
// SandboxSetDesiredReplicas tracks the desired number of replicas in each SandboxSet
SandboxSetDesiredReplicas = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "sandboxset_desired_replicas",
Help: "Desired number of replicas in the SandboxSet",
},
[]string{"namespace", "name"},
)
)
func init() {
// Register custom metrics with the global prometheus registry
metrics.Registry.MustRegister(SandboxSetReplicas, SandboxSetAvailableReplicas, SandboxSetDesiredReplicas)
}