From 5652972c53184b97865c124815d9b2065934b209 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Mon, 23 Mar 2026 10:31:44 +0200 Subject: [PATCH] fix dashboard: add refIds, explicit panel IDs, fix CrowdSec bouncer metric - Added refId to all targets (required by Grafana) - Added explicit panel IDs for stable references - Fixed CrowdSec bouncer metric: cs_lapi_bouncer_requests_total doesn't exist, use cs_lapi_route_requests_total instead - Added drawStyle/showPoints to all timeseries panels - Updated via MySQL + ConfigMap + Grafana restart --- .../dashboards/network_traffic.json | 232 ++++-------------- 1 file changed, 51 insertions(+), 181 deletions(-) diff --git a/stacks/monitoring/modules/monitoring/dashboards/network_traffic.json b/stacks/monitoring/modules/monitoring/dashboards/network_traffic.json index 20482de7..e13e2da8 100644 --- a/stacks/monitoring/modules/monitoring/dashboards/network_traffic.json +++ b/stacks/monitoring/modules/monitoring/dashboards/network_traffic.json @@ -20,247 +20,117 @@ "links": [], "panels": [ { - "title": "GoFlow2 Status", - "type": "stat", + "id": 1, "title": "GoFlow2 Status", "type": "stat", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 }, - "fieldConfig": { - "defaults": { - "color": { "mode": "thresholds" }, - "thresholds": { - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 1 } - ] - }, - "mappings": [ - { "type": "value", "options": { "0": { "text": "DOWN", "color": "red" }, "1": { "text": "UP", "color": "green" } } } - ] - } - }, - "targets": [ - { "expr": "up{job=\"goflow2\"}", "legendFormat": "GoFlow2" } - ] + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }, "mappings": [{ "type": "value", "options": { "0": { "text": "DOWN", "color": "red" }, "1": { "text": "UP", "color": "green" } } }] } }, + "targets": [{ "expr": "up{job=\"goflow2\"}", "legendFormat": "GoFlow2", "refId": "A" }] }, { - "title": "NetFlow Bytes/s", - "type": "stat", + "id": 2, "title": "NetFlow Bytes/s", "type": "stat", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 }, - "fieldConfig": { - "defaults": { - "color": { "mode": "thresholds" }, - "unit": "Bps", - "thresholds": { - "steps": [ - { "color": "green", "value": null }, - { "color": "yellow", "value": 10485760 }, - { "color": "red", "value": 104857600 } - ] - } - } - }, - "targets": [ - { "expr": "sum(rate(goflow2_flow_traffic_bytes_total[5m]))", "legendFormat": "Total" } - ] + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "unit": "Bps", "thresholds": { "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 10485760 }, { "color": "red", "value": 104857600 }] } } }, + "targets": [{ "expr": "sum(rate(goflow2_flow_traffic_bytes_total[5m]))", "legendFormat": "Total", "refId": "A" }] }, { - "title": "Flows Processed/s", - "type": "stat", + "id": 3, "title": "Flows/s", "type": "stat", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 }, - "fieldConfig": { - "defaults": { - "color": { "mode": "thresholds" }, - "unit": "short", - "decimals": 1, - "thresholds": { - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 0.1 } - ] - } - } - }, - "targets": [ - { "expr": "sum(rate(goflow2_flow_process_nf_total[5m]))", "legendFormat": "flows/s" } - ] + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "unit": "short", "decimals": 1, "thresholds": { "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 0.1 }] } } }, + "targets": [{ "expr": "sum(rate(goflow2_flow_process_nf_total[5m]))", "legendFormat": "flows/s", "refId": "A" }] }, { - "title": "CrowdSec Active Decisions", - "type": "stat", + "id": 4, "title": "CrowdSec Decisions", "type": "stat", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 0 }, - "fieldConfig": { - "defaults": { - "color": { "mode": "thresholds" }, - "thresholds": { - "steps": [ - { "color": "green", "value": null }, - { "color": "yellow", "value": 50 }, - { "color": "red", "value": 200 } - ] - } - } - }, - "targets": [ - { "expr": "cs_active_decisions", "legendFormat": "Decisions" } - ] + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 50 }, { "color": "red", "value": 200 }] } } }, + "targets": [{ "expr": "cs_active_decisions", "legendFormat": "Decisions", "refId": "A" }] }, { - "title": "DNS Queries (Last Hour)", - "type": "stat", + "id": 5, "title": "DNS Queries (Last Hour)", "type": "stat", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 }, - "fieldConfig": { - "defaults": { - "color": { "mode": "thresholds" }, - "thresholds": { - "steps": [ - { "color": "green", "value": null }, - { "color": "yellow", "value": 5000 }, - { "color": "red", "value": 20000 } - ] - } - } - }, - "targets": [ - { "expr": "dns_anomaly_total_queries", "legendFormat": "Queries" } - ] + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 5000 }, { "color": "red", "value": 20000 }] } } }, + "targets": [{ "expr": "dns_anomaly_total_queries", "legendFormat": "Queries", "refId": "A" }] }, { - "title": "DNS DGA Suspects", - "type": "stat", + "id": 6, "title": "DNS DGA Suspects", "type": "stat", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 4, "w": 4, "x": 20, "y": 0 }, - "fieldConfig": { - "defaults": { - "color": { "mode": "thresholds" }, - "thresholds": { - "steps": [ - { "color": "green", "value": null }, - { "color": "yellow", "value": 1 }, - { "color": "red", "value": 5 } - ] - } - } - }, - "targets": [ - { "expr": "dns_anomaly_dga_suspects", "legendFormat": "DGA Suspects" } - ] + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 1 }, { "color": "red", "value": 5 }] } } }, + "targets": [{ "expr": "dns_anomaly_dga_suspects", "legendFormat": "DGA Suspects", "refId": "A" }] }, { - "title": "NetFlow Bytes/s Over Time", - "type": "timeseries", + "id": 7, "title": "NetFlow Bytes/s Over Time", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 }, - "fieldConfig": { - "defaults": { - "unit": "Bps", - "custom": { "fillOpacity": 20, "lineWidth": 2 } - } - }, - "targets": [ - { "expr": "sum(rate(goflow2_flow_traffic_bytes_total[5m]))", "legendFormat": "NetFlow Bytes/s" } - ] + "fieldConfig": { "defaults": { "unit": "Bps", "custom": { "fillOpacity": 20, "lineWidth": 2, "drawStyle": "line", "showPoints": "never" } } }, + "targets": [{ "expr": "sum(rate(goflow2_flow_traffic_bytes_total[5m]))", "legendFormat": "NetFlow Bytes/s", "refId": "A" }] }, { - "title": "NetFlow Flows Processed/s (by version)", - "type": "timeseries", + "id": 8, "title": "NetFlow Flows/s (by version)", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 }, - "fieldConfig": { - "defaults": { - "unit": "short", - "custom": { "fillOpacity": 15, "lineWidth": 2 } - } - }, + "fieldConfig": { "defaults": { "unit": "short", "custom": { "fillOpacity": 15, "lineWidth": 2, "drawStyle": "line", "showPoints": "never" } } }, "targets": [ - { "expr": "rate(goflow2_flow_process_nf_total[5m])", "legendFormat": "v{{ version }} flows/s" }, - { "expr": "rate(goflow2_flow_decoder_error_total[5m])", "legendFormat": "Decoder errors/s" }, - { "expr": "rate(goflow2_flow_process_nf_errors_total[5m])", "legendFormat": "Errors/s ({{ error }})" } + { "expr": "rate(goflow2_flow_process_nf_total[5m])", "legendFormat": "v{{version}} flows/s", "refId": "A" }, + { "expr": "rate(goflow2_flow_decoder_error_total[5m])", "legendFormat": "Decoder errors/s", "refId": "B" }, + { "expr": "rate(goflow2_flow_process_nf_errors_total[5m])", "legendFormat": "Errors/s ({{error}})", "refId": "C" } ] }, { - "title": "NetFlow Processing Delay", - "type": "timeseries", + "id": 9, "title": "NetFlow Processing Delay", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 12 }, - "fieldConfig": { - "defaults": { - "unit": "s", - "custom": { "fillOpacity": 10, "lineWidth": 1 } - } - }, + "fieldConfig": { "defaults": { "unit": "s", "custom": { "fillOpacity": 10, "lineWidth": 1, "drawStyle": "line", "showPoints": "never" } } }, "targets": [ - { "expr": "goflow2_flow_process_nf_delay_seconds{quantile=\"0.5\"}", "legendFormat": "p50 delay" }, - { "expr": "goflow2_flow_process_nf_delay_seconds{quantile=\"0.9\"}", "legendFormat": "p90 delay" }, - { "expr": "goflow2_flow_process_nf_delay_seconds{quantile=\"0.99\"}", "legendFormat": "p99 delay" } + { "expr": "goflow2_flow_process_nf_delay_seconds{quantile=\"0.5\"}", "legendFormat": "p50 delay", "refId": "A" }, + { "expr": "goflow2_flow_process_nf_delay_seconds{quantile=\"0.9\"}", "legendFormat": "p90 delay", "refId": "B" }, + { "expr": "goflow2_flow_process_nf_delay_seconds{quantile=\"0.99\"}", "legendFormat": "p99 delay", "refId": "C" } ] }, { - "title": "CrowdSec Alerts & Decisions Over Time", - "type": "timeseries", + "id": 10, "title": "CrowdSec Alerts & Decisions", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 12 }, - "fieldConfig": { - "defaults": { - "custom": { "fillOpacity": 15, "lineWidth": 2 } - } - }, + "fieldConfig": { "defaults": { "custom": { "fillOpacity": 15, "lineWidth": 2, "drawStyle": "line", "showPoints": "never" } } }, "targets": [ - { "expr": "cs_active_decisions", "legendFormat": "Active Decisions" }, - { "expr": "cs_alerts", "legendFormat": "Total Alerts" }, - { "expr": "sum(rate(cs_lapi_bouncer_requests_total[5m]))", "legendFormat": "Bouncer req/s" } + { "expr": "cs_active_decisions", "legendFormat": "Active Decisions", "refId": "A" }, + { "expr": "cs_alerts", "legendFormat": "Total Alerts", "refId": "B" }, + { "expr": "sum(rate(cs_lapi_route_requests_total[5m]))", "legendFormat": "LAPI req/s", "refId": "C" } ] }, { - "title": "CrowdSec LAPI Request Latency", - "type": "timeseries", + "id": 11, "title": "CrowdSec LAPI Latency", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 12 }, - "fieldConfig": { - "defaults": { - "unit": "s", - "custom": { "fillOpacity": 10, "lineWidth": 1 } - } - }, + "fieldConfig": { "defaults": { "unit": "s", "custom": { "fillOpacity": 10, "lineWidth": 1, "drawStyle": "line", "showPoints": "never" } } }, "targets": [ - { "expr": "histogram_quantile(0.50, sum(rate(cs_lapi_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p50" }, - { "expr": "histogram_quantile(0.99, sum(rate(cs_lapi_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p99" } + { "expr": "histogram_quantile(0.50, sum(rate(cs_lapi_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p50", "refId": "A" }, + { "expr": "histogram_quantile(0.99, sum(rate(cs_lapi_request_duration_seconds_bucket[5m])) by (le))", "legendFormat": "p99", "refId": "B" } ] }, { - "title": "NetFlow Flowset Records by Type", - "type": "timeseries", + "id": 12, "title": "NetFlow Flowset Records/s", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 20 }, - "fieldConfig": { - "defaults": { - "unit": "short", - "custom": { "fillOpacity": 15, "lineWidth": 1 } - } - }, + "fieldConfig": { "defaults": { "unit": "short", "custom": { "fillOpacity": 15, "lineWidth": 1, "drawStyle": "line", "showPoints": "never" } } }, "targets": [ - { "expr": "rate(goflow2_flow_process_nf_flowset_records_total[5m])", "legendFormat": "{{ type }} (v{{ version }})" } + { "expr": "rate(goflow2_flow_process_nf_flowset_records_total[5m])", "legendFormat": "{{type}} (v{{version}})", "refId": "A" } ] }, { - "title": "DNS Metrics Over Time", - "type": "timeseries", + "id": 13, "title": "DNS Metrics Over Time", "type": "timeseries", "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 20 }, - "fieldConfig": { - "defaults": { - "custom": { "fillOpacity": 15, "lineWidth": 2 } - } - }, + "fieldConfig": { "defaults": { "custom": { "fillOpacity": 15, "lineWidth": 2, "drawStyle": "line", "showPoints": "never" } } }, "targets": [ - { "expr": "dns_anomaly_total_queries", "legendFormat": "Total Queries" }, - { "expr": "dns_anomaly_nx_domain", "legendFormat": "NX Domain" }, - { "expr": "dns_anomaly_server_failure", "legendFormat": "SERVFAIL" }, - { "expr": "dns_anomaly_blocked", "legendFormat": "Blocked" }, - { "expr": "dns_anomaly_dga_suspects", "legendFormat": "DGA Suspects" } + { "expr": "dns_anomaly_total_queries", "legendFormat": "Total Queries", "refId": "A" }, + { "expr": "dns_anomaly_nx_domain", "legendFormat": "NX Domain", "refId": "B" }, + { "expr": "dns_anomaly_server_failure", "legendFormat": "SERVFAIL", "refId": "C" }, + { "expr": "dns_anomaly_blocked", "legendFormat": "Blocked", "refId": "D" }, + { "expr": "dns_anomaly_dga_suspects", "legendFormat": "DGA Suspects", "refId": "E" } ] } ], @@ -272,5 +142,5 @@ "timezone": "browser", "title": "Network Traffic & Adversary Detection", "uid": "network-traffic-adversary", - "version": 2 + "version": 4 }