Skip to content

Commit 25c19c2

Browse files
authored
feat: add VoIP stack Grafana dashboards and Prometheus targets (#123)
Add monitoring for voip-stack Lima VMs (sip-1, pbx-1, media-1): - Add voip-nodes job to Prometheus scrape config - Add VoIP Stack Overview dashboard (all VMs status) - Add OpenSIPS Overview dashboard (SIP proxy metrics) - Add Asterisk Overview dashboard (PBX metrics) - Add RTPEngine Overview dashboard (media relay metrics) Dashboards use node_exporter metrics from the VoIP VMs.
1 parent 83ebfdd commit 25c19c2

5 files changed

Lines changed: 711 additions & 0 deletions

File tree

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{
2+
"title": "Asterisk Overview",
3+
"uid": "asterisk-overview",
4+
"tags": ["voip", "asterisk", "pbx", "sip"],
5+
"refresh": "30s",
6+
"time": {
7+
"from": "now-1h",
8+
"to": "now"
9+
},
10+
"panels": [
11+
{
12+
"title": "Asterisk VM Status",
13+
"type": "stat",
14+
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 0},
15+
"targets": [
16+
{
17+
"expr": "up{job=\"voip-nodes\", instance=\"pbx-1\"}",
18+
"legendFormat": "pbx-1",
19+
"refId": "A"
20+
}
21+
],
22+
"fieldConfig": {
23+
"defaults": {
24+
"mappings": [{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}],
25+
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": 0}, {"color": "green", "value": 1}]}
26+
}
27+
},
28+
"options": {"colorMode": "background", "graphMode": "none"},
29+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
30+
},
31+
{
32+
"title": "Asterisk Info",
33+
"type": "text",
34+
"gridPos": {"h": 4, "w": 18, "x": 6, "y": 0},
35+
"options": {
36+
"mode": "markdown",
37+
"content": "## Asterisk PBX (pbx-1)\n\n**Role:** Call processing, voicemail, IVR, recording\n\n| Port | Protocol | Purpose |\n|------|----------|--------|\n| 5080 | UDP | SIP (internal) |\n| 5038 | TCP | AMI (Asterisk Manager Interface) |\n| 8088 | TCP | ARI (Asterisk REST Interface) |\n\n*Note: Asterisk-specific metrics require asterisk_exporter to be installed*"
38+
}
39+
},
40+
{
41+
"title": "CPU Usage",
42+
"type": "timeseries",
43+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 4},
44+
"targets": [
45+
{
46+
"expr": "100 - (avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"pbx-1\", mode=\"idle\"}[5m])) * 100)",
47+
"legendFormat": "CPU %",
48+
"refId": "A"
49+
}
50+
],
51+
"fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100}},
52+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
53+
},
54+
{
55+
"title": "Memory Usage",
56+
"type": "timeseries",
57+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 4},
58+
"targets": [
59+
{
60+
"expr": "node_memory_MemTotal_bytes{job=\"voip-nodes\", instance=\"pbx-1\"} - node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"pbx-1\"}",
61+
"legendFormat": "Used",
62+
"refId": "A"
63+
},
64+
{
65+
"expr": "node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"pbx-1\"}",
66+
"legendFormat": "Available",
67+
"refId": "B"
68+
}
69+
],
70+
"fieldConfig": {"defaults": {"unit": "bytes"}},
71+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
72+
},
73+
{
74+
"title": "Network I/O",
75+
"type": "timeseries",
76+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 12},
77+
"targets": [
78+
{
79+
"expr": "rate(node_network_receive_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\", device=\"lima0\"}[5m])",
80+
"legendFormat": "RX",
81+
"refId": "A"
82+
},
83+
{
84+
"expr": "rate(node_network_transmit_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\", device=\"lima0\"}[5m])",
85+
"legendFormat": "TX",
86+
"refId": "B"
87+
}
88+
],
89+
"fieldConfig": {"defaults": {"unit": "Bps"}},
90+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
91+
},
92+
{
93+
"title": "Disk I/O (Recording Storage)",
94+
"type": "timeseries",
95+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 12},
96+
"targets": [
97+
{
98+
"expr": "rate(node_disk_read_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\"}[5m])",
99+
"legendFormat": "Read",
100+
"refId": "A"
101+
},
102+
{
103+
"expr": "rate(node_disk_written_bytes_total{job=\"voip-nodes\", instance=\"pbx-1\"}[5m])",
104+
"legendFormat": "Write",
105+
"refId": "B"
106+
}
107+
],
108+
"fieldConfig": {"defaults": {"unit": "Bps"}},
109+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
110+
},
111+
{
112+
"title": "Disk Usage",
113+
"type": "gauge",
114+
"gridPos": {"h": 6, "w": 8, "x": 0, "y": 20},
115+
"targets": [
116+
{
117+
"expr": "(1 - (node_filesystem_avail_bytes{job=\"voip-nodes\", instance=\"pbx-1\", mountpoint=\"/\"} / node_filesystem_size_bytes{job=\"voip-nodes\", instance=\"pbx-1\", mountpoint=\"/\"})) * 100",
118+
"legendFormat": "Root",
119+
"refId": "A"
120+
}
121+
],
122+
"fieldConfig": {
123+
"defaults": {
124+
"unit": "percent",
125+
"min": 0,
126+
"max": 100,
127+
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": 0}, {"color": "yellow", "value": 70}, {"color": "red", "value": 85}]}
128+
}
129+
},
130+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
131+
},
132+
{
133+
"title": "Process Count",
134+
"type": "stat",
135+
"gridPos": {"h": 6, "w": 8, "x": 8, "y": 20},
136+
"targets": [
137+
{
138+
"expr": "node_procs_running{job=\"voip-nodes\", instance=\"pbx-1\"}",
139+
"legendFormat": "Running",
140+
"refId": "A"
141+
},
142+
{
143+
"expr": "node_procs_blocked{job=\"voip-nodes\", instance=\"pbx-1\"}",
144+
"legendFormat": "Blocked",
145+
"refId": "B"
146+
}
147+
],
148+
"options": {"colorMode": "value", "graphMode": "area"},
149+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
150+
},
151+
{
152+
"title": "File Descriptors",
153+
"type": "timeseries",
154+
"gridPos": {"h": 6, "w": 8, "x": 16, "y": 20},
155+
"targets": [
156+
{
157+
"expr": "node_filefd_allocated{job=\"voip-nodes\", instance=\"pbx-1\"}",
158+
"legendFormat": "Allocated",
159+
"refId": "A"
160+
},
161+
{
162+
"expr": "node_filefd_maximum{job=\"voip-nodes\", instance=\"pbx-1\"}",
163+
"legendFormat": "Maximum",
164+
"refId": "B"
165+
}
166+
],
167+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
168+
}
169+
]
170+
}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"title": "OpenSIPS Overview",
3+
"uid": "opensips-overview",
4+
"tags": ["voip", "opensips", "sip", "proxy"],
5+
"refresh": "30s",
6+
"time": {
7+
"from": "now-1h",
8+
"to": "now"
9+
},
10+
"panels": [
11+
{
12+
"title": "OpenSIPS VM Status",
13+
"type": "stat",
14+
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 0},
15+
"targets": [
16+
{
17+
"expr": "up{job=\"voip-nodes\", instance=\"sip-1\"}",
18+
"legendFormat": "sip-1",
19+
"refId": "A"
20+
}
21+
],
22+
"fieldConfig": {
23+
"defaults": {
24+
"mappings": [{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}],
25+
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": 0}, {"color": "green", "value": 1}]}
26+
}
27+
},
28+
"options": {"colorMode": "background", "graphMode": "none"},
29+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
30+
},
31+
{
32+
"title": "OpenSIPS Info",
33+
"type": "text",
34+
"gridPos": {"h": 4, "w": 18, "x": 6, "y": 0},
35+
"options": {
36+
"mode": "markdown",
37+
"content": "## OpenSIPS SIP Proxy (sip-1)\n\n**Role:** SIP registration, routing, load balancing\n\n| Port | Protocol | Purpose |\n|------|----------|--------|\n| 5060 | UDP/TCP | SIP Signaling |\n| 5061 | TCP | SIP/TLS |\n| 8080 | TCP | WebSocket |\n| 8443 | TCP | WebSocket Secure |\n\n*Note: OpenSIPS-specific metrics require opensips_exporter to be installed*"
38+
}
39+
},
40+
{
41+
"title": "CPU Usage",
42+
"type": "timeseries",
43+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 4},
44+
"targets": [
45+
{
46+
"expr": "100 - (avg(irate(node_cpu_seconds_total{job=\"voip-nodes\", instance=\"sip-1\", mode=\"idle\"}[5m])) * 100)",
47+
"legendFormat": "CPU %",
48+
"refId": "A"
49+
}
50+
],
51+
"fieldConfig": {"defaults": {"unit": "percent", "min": 0, "max": 100, "color": {"mode": "palette-classic"}}},
52+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
53+
},
54+
{
55+
"title": "Memory Usage",
56+
"type": "timeseries",
57+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 4},
58+
"targets": [
59+
{
60+
"expr": "node_memory_MemTotal_bytes{job=\"voip-nodes\", instance=\"sip-1\"} - node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"sip-1\"}",
61+
"legendFormat": "Used",
62+
"refId": "A"
63+
},
64+
{
65+
"expr": "node_memory_MemAvailable_bytes{job=\"voip-nodes\", instance=\"sip-1\"}",
66+
"legendFormat": "Available",
67+
"refId": "B"
68+
}
69+
],
70+
"fieldConfig": {"defaults": {"unit": "bytes"}},
71+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
72+
},
73+
{
74+
"title": "Network I/O",
75+
"type": "timeseries",
76+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 12},
77+
"targets": [
78+
{
79+
"expr": "rate(node_network_receive_bytes_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])",
80+
"legendFormat": "RX",
81+
"refId": "A"
82+
},
83+
{
84+
"expr": "rate(node_network_transmit_bytes_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])",
85+
"legendFormat": "TX",
86+
"refId": "B"
87+
}
88+
],
89+
"fieldConfig": {"defaults": {"unit": "Bps"}},
90+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
91+
},
92+
{
93+
"title": "Network Packets",
94+
"type": "timeseries",
95+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 12},
96+
"targets": [
97+
{
98+
"expr": "rate(node_network_receive_packets_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])",
99+
"legendFormat": "RX Packets",
100+
"refId": "A"
101+
},
102+
{
103+
"expr": "rate(node_network_transmit_packets_total{job=\"voip-nodes\", instance=\"sip-1\", device=\"lima0\"}[5m])",
104+
"legendFormat": "TX Packets",
105+
"refId": "B"
106+
}
107+
],
108+
"fieldConfig": {"defaults": {"unit": "pps"}},
109+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
110+
},
111+
{
112+
"title": "UDP Connections (SIP Traffic Indicator)",
113+
"type": "timeseries",
114+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 20},
115+
"targets": [
116+
{
117+
"expr": "node_sockstat_UDP_inuse{job=\"voip-nodes\", instance=\"sip-1\"}",
118+
"legendFormat": "UDP Sockets",
119+
"refId": "A"
120+
}
121+
],
122+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
123+
},
124+
{
125+
"title": "TCP Connections",
126+
"type": "timeseries",
127+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 20},
128+
"targets": [
129+
{
130+
"expr": "node_sockstat_TCP_inuse{job=\"voip-nodes\", instance=\"sip-1\"}",
131+
"legendFormat": "TCP Established",
132+
"refId": "A"
133+
},
134+
{
135+
"expr": "node_sockstat_TCP_tw{job=\"voip-nodes\", instance=\"sip-1\"}",
136+
"legendFormat": "TCP Time-Wait",
137+
"refId": "B"
138+
}
139+
],
140+
"datasource": {"type": "prometheus", "uid": "Prometheus"}
141+
}
142+
]
143+
}

0 commit comments

Comments
 (0)