forked from jpweber/cole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetrics.go
43 lines (37 loc) · 1.07 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
package main
import "github.com/prometheus/client_golang/prometheus"
var (
timerCount = prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: "cole",
Subsystem: "server",
Name: "timer_count",
Help: "Count of active timers in the system",
})
httpDurations = prometheus.NewSummary(
prometheus.SummaryOpts{
Namespace: "cole",
Name: "http_durations_seconds",
Help: "HTTP latency distributions.",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
)
dmAlertsRecieved = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "cole",
Name: "deadman_alerts_recvd",
Help: "Number of times a DeadManSwitch has sent cole and alert.",
},
)
dmAlertsSent = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "cole",
Name: "deadman_alerts_sent",
Help: "Number of times a cole alert has been sent beause of missed DeadManSwitch alerts",
},
)
)
func init() {
prometheus.MustRegister(timerCount)
prometheus.MustRegister(httpDurations)
prometheus.MustRegister(dmAlertsRecieved)
}