-
Notifications
You must be signed in to change notification settings - Fork 5
/
metrics.go
44 lines (38 loc) · 1.08 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
38
39
40
41
42
43
44
package argo_client
import "github.com/prometheus/client_golang/prometheus"
var (
commonLabels = []string{
"application",
}
getManifestsSuccess = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "kubechecks",
Name: "get_manifests_success",
Help: "Count of all attempts to get application manifests that succeeded",
},
commonLabels,
)
getManifestsFailed = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "kubechecks",
Name: "get_manifests_failure",
Help: "Count of all attempts to get application manifests that failed",
},
commonLabels,
)
buckets = []float64{1, 30, 60, 300}
getManifestsDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "kubechecks",
Name: "get_manifests_duration_seconds",
Help: "Histogram of response time for application manifest generation",
Buckets: buckets,
},
commonLabels,
)
)
func init() {
r := prometheus.DefaultRegisterer
r.MustRegister(getManifestsFailed)
r.MustRegister(getManifestsSuccess)
r.MustRegister(getManifestsDuration)
}