This repository was archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmetrics.go
More file actions
148 lines (143 loc) · 5.85 KB
/
Copy pathmetrics.go
File metadata and controls
148 lines (143 loc) · 5.85 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
// Device metrics
ibDeviceUptime = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_uptime_seconds",
Help: "Uptime of the device in seconds",
})
ibDeviceNumberOfReboots = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_reboots",
Help: "Number of reboots of the device",
})
ibDeviceLoadAvg1Min = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_load_avg_1",
Help: "1 minute average for device load",
})
ibDeviceLoadAvg5Min = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_load_avg_5",
Help: "5 minute average for device load",
})
ibDeviceLoadAvg15Min = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_load_avg_15",
Help: "15 minute average for device load",
})
ibDeviceNumberOfProcesses = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_processes",
Help: "Number of processes",
})
ibDeviceChipTemperature = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_device_temperature_celsius",
Help: "Temperature of the WiFi chip",
}, []string{"band"})
ibDeviceMemoryTotal = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_memory_total_bytes",
Help: "Total RAM of the device",
})
ibDeviceMemoryFree = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_memory_free_bytes",
Help: "Free memory of the device",
})
ibDevicMemoryUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_device_memory_usage_bytes",
Help: "Used memory on the device, by type",
}, []string{"type"})
ibDeviceSwapTotal = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_swap_total_bytes",
Help: "Total swap space on the device",
})
ibDeviceSwapFree = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_device_swap_free_bytes",
Help: "Free swap space on the device",
})
// DSL metrics
ibDSLChannelErrorsSent = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_dsl_errors_sent_total",
Help: "Number of errors sent on the DSL channel",
})
ibDSLChannelErrorsReceived = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_dsl_errors_received_total",
Help: "Number of errors received on the DSL channel",
})
ibDSLChannelBytesSent = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_dsl_sent_bytes",
Help: "Bytes sent on the DSL channel",
})
ibDSLChannelBytesReceived = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_dsl_received_bytes",
Help: "Bytes received on the DSL channel",
})
ibDSLChannelPacketsSent = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_dsl_packets_sent_total",
Help: "Number of packets sent on the DSL channel",
})
ibDSLChannelPacketsReceived = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_dsl_packets_received_total",
Help: "Number of packets received on the DSL channel",
})
// Wifi metrics
ibWifiBytesSent = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_total_sent_bytes",
Help: "Bytes sent on the WiFi channel, per device",
}, []string{"channel", "station"})
ibWifiBytesReceived = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_total_received_bytes",
Help: "Bytes received on the WiFi channel per device",
}, []string{"channel", "station"})
ibWifiSignalStrength = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_signal_strength_db",
Help: "Signal strength in dB per channel, per device",
}, []string{"channel", "station"})
ibWifiSignalNoiseRatio = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_signal_noise_ratio",
Help: "Signal to noise ratio per channel, per device",
}, []string{"channel", "station"})
ibWifiBytesSentByBand = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_band_total_sent_bytes",
Help: "Total sent bytes by WiFi band",
}, []string{"band"})
ibWifiBytesReceivedByBand = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_band_total_received_bytes",
Help: "Total received bytes by WiFi band",
}, []string{"band"})
ibWifiDataMbps = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_data_mbps",
Help: "Megabytes per second on data channel, by band and station",
}, []string{"band", "station"})
ibWifiPhyMbps = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_phy_mbps",
Help: "Megabytes per second on physical channel, by band and station",
}, []string{"band", "station"})
ibWifiAirUse = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_air_use_percentage",
Help: "Air use percentage, by band and station",
}, []string{"band", "station"})
ibWifiDataUse = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_wifi_data_use_percentage",
Help: "Data use percentage, by band and station",
}, []string{"band", "station"})
// Connected devices
ibClientsNumberOfActiveDevices = promauto.NewGauge(prometheus.GaugeOpts{
Name: "internetbox_client_devices_count",
Help: "Currently connected devices, by interface",
})
ibClientRxBytes = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_client_total_rx_bytes",
Help: "Receiving bytes, by client",
}, []string{"station", "ip", "interface"})
ibClientTxBytes = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_client_total_tx_bytes",
Help: "Transmitted bytes, by client",
}, []string{"station", "ip", "interface"})
ibClientSignalStrength = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_client_signalstrength",
Help: "Signal strength",
}, []string{"station", "ip", "interface"})
ibClientNoise = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "internetbox_client_noise",
Help: "Client noise",
}, []string{"station", "ip", "interface"})
)