infra/ansible/roles/grafana/files/dashboards/tmobile-home-internet.json
Graham McIntire 8466e4590f
tmobile-exporter: switch to stock json_exporter + nginx sidecar
Replaces the vendored Go exporter with two pre-built upstream images:
- quay.io/prometheuscommunity/json-exporter:v0.7.0 maps the gateway JSON
  into prometheus metrics via JSONPath. The G4AR keys signal blocks as
  "5g" / "4g" (digit-prefixed), which the k8s client-go JSONPath dialect
  only reaches via bracket-with-single-quote notation.
- nginxinc/nginx-unprivileged:1.27-alpine-slim sidecar rewrites
  GET /metrics → GET /probe?module=tmhi&target=http://192.168.12.1/...
  so the existing kubernetes-services scrape job picks it up over the
  apiserver proxy with no Prometheus-side config changes.

Avoiding caddy here: its binary carries cap_net_bind_service file caps,
which the kernel refuses to exec under no_new_privs as a non-root user.

Dashboard "Gateway up" panel now reads up{service="tmobile-exporter"}
(Prometheus's built-in scrape-success gauge) since json_exporter's
/probe endpoint does not emit probe_success.
2026-05-10 17:57:13 -05:00

365 lines
12 KiB
JSON

{
"uid": "tmobile-home-internet",
"title": "T-Mobile Home Internet",
"tags": ["network", "tmobile", "5g"],
"schemaVersion": 38,
"version": 1,
"timezone": "",
"refresh": "30s",
"time": {"from": "now-6h", "to": "now"},
"editable": true,
"graphTooltip": 1,
"templating": {
"list": [
{
"name": "datasource",
"label": "Datasource",
"type": "datasource",
"query": "prometheus",
"current": {"text": "Prometheus", "value": "Prometheus", "selected": false},
"hide": 0,
"includeAll": false,
"multi": false,
"refresh": 1,
"skipUrlSync": false
},
{
"name": "band_5g",
"label": "5G band",
"type": "query",
"datasource": "$datasource",
"query": {"query": "label_values(tmobile_gateway_rsrp{type=\"5g\"}, band)", "refId": "StandardVariableQuery"},
"definition": "label_values(tmobile_gateway_rsrp{type=\"5g\"}, band)",
"hide": 0,
"includeAll": true,
"multi": true,
"refresh": 2,
"regex": "",
"sort": 1,
"skipUrlSync": false
},
{
"name": "band_4g",
"label": "4G band",
"type": "query",
"datasource": "$datasource",
"query": {"query": "label_values(tmobile_gateway_rsrp{type=\"4g\"}, band)", "refId": "StandardVariableQuery"},
"definition": "label_values(tmobile_gateway_rsrp{type=\"4g\"}, band)",
"hide": 0,
"includeAll": true,
"multi": true,
"refresh": 2,
"regex": "",
"sort": 1,
"skipUrlSync": false
}
]
},
"panels": [
{
"type": "row",
"id": 100,
"title": "Overview",
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0}
},
{
"type": "stat",
"id": 1,
"title": "Gateway up",
"datasource": "$datasource",
"gridPos": {"h": 4, "w": 6, "x": 0, "y": 1},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [
{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}
],
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "green", "value": 1}
]}
}
},
"options": {
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"graphMode": "none",
"colorMode": "background",
"textMode": "value"
},
"targets": [
{"expr": "up{service=\"tmobile-exporter\"}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "stat",
"id": 2,
"title": "Uptime",
"datasource": "$datasource",
"gridPos": {"h": 4, "w": 6, "x": 6, "y": 1},
"fieldConfig": {
"defaults": {
"unit": "s",
"color": {"mode": "thresholds"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "green", "value": 300}
]}
}
},
"options": {
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"graphMode": "area",
"colorMode": "value"
},
"targets": [
{"expr": "max(tmobile_gateway_uptime_seconds)", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "stat",
"id": 3,
"title": "5G bars",
"datasource": "$datasource",
"gridPos": {"h": 4, "w": 6, "x": 12, "y": 1},
"fieldConfig": {
"defaults": {
"min": 0,
"max": 5,
"color": {"mode": "thresholds"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": 2},
{"color": "yellow", "value": 3},
{"color": "green", "value": 4}
]}
}
},
"options": {
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"graphMode": "area",
"colorMode": "value"
},
"targets": [
{"expr": "max(tmobile_gateway_bars{type=\"5g\"})", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "stat",
"id": 4,
"title": "4G bars",
"datasource": "$datasource",
"gridPos": {"h": 4, "w": 6, "x": 18, "y": 1},
"fieldConfig": {
"defaults": {
"min": 0,
"max": 5,
"color": {"mode": "thresholds"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": 2},
{"color": "yellow", "value": 3},
{"color": "green", "value": 4}
]}
}
},
"options": {
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"graphMode": "area",
"colorMode": "value"
},
"targets": [
{"expr": "max(tmobile_gateway_bars{type=\"4g\"})", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "row",
"id": 101,
"title": "5G signal",
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 5}
},
{
"type": "timeseries",
"id": 10,
"title": "RSRP 5G (dBm)",
"datasource": "$datasource",
"description": "Reference Signal Received Power. Better closer to 0; -80 to -90 is excellent, below -110 is poor.",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 6},
"fieldConfig": {
"defaults": {
"unit": "dBm",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": -110},
{"color": "yellow", "value": -100},
{"color": "green", "value": -90}
]}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_rsrp{type=\"5g\", band=~\"$band_5g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "timeseries",
"id": 11,
"title": "RSRQ 5G (dB)",
"datasource": "$datasource",
"description": "Reference Signal Received Quality. Better closer to 0; -10 or higher is excellent, below -20 is poor.",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 6},
"fieldConfig": {
"defaults": {
"unit": "dB",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": -20},
{"color": "yellow", "value": -15},
{"color": "green", "value": -10}
]}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_rsrq{type=\"5g\", band=~\"$band_5g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "timeseries",
"id": 12,
"title": "SNR 5G (dB)",
"datasource": "$datasource",
"description": "Signal to noise. Higher is better; >20 dB is excellent, <5 dB is poor.",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 14},
"fieldConfig": {
"defaults": {
"unit": "dB",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": 5},
{"color": "yellow", "value": 13},
{"color": "green", "value": 20}
]}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_snr{type=\"5g\", band=~\"$band_5g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "timeseries",
"id": 13,
"title": "RSSI 5G (dBm)",
"datasource": "$datasource",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 14},
"fieldConfig": {
"defaults": {
"unit": "dBm",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_rssi{type=\"5g\", band=~\"$band_5g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "row",
"id": 102,
"title": "4G signal",
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 22}
},
{
"type": "timeseries",
"id": 20,
"title": "RSRP 4G (dBm)",
"datasource": "$datasource",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 23},
"fieldConfig": {
"defaults": {
"unit": "dBm",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": -110},
{"color": "yellow", "value": -100},
{"color": "green", "value": -90}
]}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_rsrp{type=\"4g\", band=~\"$band_4g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "timeseries",
"id": 21,
"title": "RSRQ 4G (dB)",
"datasource": "$datasource",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 23},
"fieldConfig": {
"defaults": {
"unit": "dB",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": -20},
{"color": "yellow", "value": -15},
{"color": "green", "value": -10}
]}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_rsrq{type=\"4g\", band=~\"$band_4g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "timeseries",
"id": 22,
"title": "SNR 4G (dB)",
"datasource": "$datasource",
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 31},
"fieldConfig": {
"defaults": {
"unit": "dB",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"},
"thresholds": {"mode": "absolute", "steps": [
{"color": "red", "value": null},
{"color": "orange", "value": 5},
{"color": "yellow", "value": 13},
{"color": "green", "value": 20}
]}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_snr{type=\"4g\", band=~\"$band_4g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
},
{
"type": "timeseries",
"id": 23,
"title": "RSSI 4G (dBm)",
"datasource": "$datasource",
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 31},
"fieldConfig": {
"defaults": {
"unit": "dBm",
"custom": {"lineWidth": 1, "fillOpacity": 10, "showPoints": "never"}
}
},
"options": {"legend": {"showLegend": true, "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}},
"targets": [
{"expr": "tmobile_gateway_rssi{type=\"4g\", band=~\"$band_4g\"}", "legendFormat": "{{band}}", "refId": "A", "datasource": "$datasource"}
]
}
]
}