forked from bartlettc22/surfboard_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
executable file
·87 lines (67 loc) · 2.96 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
// Info metrics
modemInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_info",
Help: "Information about the modem hardware/firmware",
}, []string{"model_name", "vendor_name", "firmware_name", "boot_version", "hardware_version", "serial_number", "firmware_build_time"})
modemAddresses = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_addresses",
Help: "Information about the modem addresses",
}, []string{"serial_number", "hfc_mac", "ethernet_ip", "ethernet_mac", "cpe_mac", "cpe_mac_status"})
// Downstream metrics
modemDownstreamFrequency = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_downstream_freq",
Help: "Modem's downstream signal frequency (Hz)",
}, []string{"channel_id"})
modemDownstreamSNR = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_downstream_snr",
Help: "Modem's downstream signal-to-noise ratio (dB)",
}, []string{"channel_id"})
modemDownstreamModulation = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_downstream_modulation",
Help: "Modem's downstream modulation method",
}, []string{"channel_id", "modulation_method"})
modemDownstreamPower = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_downstream_power",
Help: "Modem's downstream power level (dBmV)",
}, []string{"channel_id"})
// Upstream metrics
modemUpstreamChannelInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_upstream_channel_info",
Help: "Modem's upstream channel info",
}, []string{"channel_id", "ranging_service_id", "modulation_methods"})
modemUpstreamFrequency = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_upstream_freq",
Help: "Modem's upstream signal frequency (Hz)",
}, []string{"channel_id"})
modemUpstreamSymbolRate = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_upstream_symbol_rate",
Help: "Modem's upstream symbol rate (Msym/sec)",
}, []string{"channel_id"})
modemUpstreamPower = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_upstream_power",
Help: "Modem's upstream power level (dBmV)",
}, []string{"channel_id"})
modemUpstreamRangingStatus = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_upstream_ranging_status",
Help: "Modem's upstream ranging status",
}, []string{"channel_id"})
// Codeword metrics
modemCodewordsUnerrored = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_codewords_unerrored_total",
Help: "Modem's total unerrored codewords",
}, []string{"channel_id"})
modemCodewordsCorrectable = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_codewords_correctable_total",
Help: "Modem's total correctable codewords",
}, []string{"channel_id"})
modemCodewordsUncorrectable = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "modem_codewords_uncorrectable_total",
Help: "Modem's total uncorrectable codewords",
}, []string{"channel_id"})
)