-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathprom.go
29 lines (26 loc) · 933 Bytes
/
prom.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
package redplex
import "github.com/prometheus/client_golang/prometheus"
var (
clientsCount = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "redplex_clients",
Help: "Number of subscribers currently connected through Redplex",
})
serverReconnects = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "redplex_reconnects",
Help: "Number of times this server has reconnected to the remote Redis instance",
})
throughputMessages = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "redplex_messages_count",
Help: "Number messages this instance has sent to subscribers.",
})
throughputBytes = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "redplex_bytes_count",
Help: "Number bytes this instance has sent to subscribers.",
})
)
func init() {
prometheus.MustRegister(clientsCount)
prometheus.MustRegister(serverReconnects)
prometheus.MustRegister(throughputMessages)
prometheus.MustRegister(throughputBytes)
}