/
metrics.go
37 lines (33 loc) · 1.14 KB
/
metrics.go
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
package services
import (
"github.com/prometheus/client_golang/prometheus"
)
// MetricRequeueServiceCount is the number of times a particular service has been requeued.
var MetricRequeueServiceCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "",
Subsystem: "",
Name: "requeue_service_total",
Help: "A metric that captures the number of times a service is requeued after failing to sync"},
[]string{
"name",
},
)
// MetricSyncServiceCount is the number of times a particular service has been synced.
var MetricSyncServiceCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "",
Subsystem: "",
Name: "sync_service_total",
Help: "A metric that captures the number of times a service is synced"},
[]string{
"name",
},
)
// MetricSyncServiceLatency is the time taken to sync a service with the OVN load balancers.
var MetricSyncServiceLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "",
Subsystem: "",
Name: "sync_service_latency_seconds",
Help: "The latency of syncing a service",
Buckets: prometheus.ExponentialBuckets(.1, 2, 15)},
[]string{"name"},
)