-
Notifications
You must be signed in to change notification settings - Fork 1
/
metrics.go
49 lines (46 loc) · 1.27 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
45
46
47
48
49
package main
import "github.com/prometheus/client_golang/prometheus"
var (
songsPlayed = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "xtradio_songs_played",
Help: "Number of songs played.",
},
[]string{"artist", "title", "show"},
)
tuneinSubmission = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "xtradio_tunein_submission",
Help: "Successfull TuneIn.com submissions.",
},
[]string{"artist", "title"},
)
dbConnectionFailure = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "xtradio_db_connection_fail",
Help: "Failed connections to the DB.",
},
)
liqConnectionFailure = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "xtradio_liquidsoap_connection_fail",
Help: "Failed number of connections to Liquidsoap",
},
[]string{"host", "port"},
)
// hdFailures = prometheus.NewCounterVec(
// prometheus.CounterOpts{
// Name: "hd_errors_total",
// Help: "Number of hard-disk errors.",
// },
// []string{"device"},
// )
)
func init() {
// Metrics have to be registered to be exposed:
prometheus.MustRegister(songsPlayed)
prometheus.MustRegister(tuneinSubmission)
prometheus.MustRegister(dbConnectionFailure)
prometheus.MustRegister(liqConnectionFailure)
// prometheus.MustRegister(hdFailures)
}