From f430758992a53862609399bd23dd761bfdaaf485 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 18 May 2026 20:29:59 -0700 Subject: [PATCH] Scope NOC Overview "Peers Down" panels to the dashboard time range The scorecard and table counted every bgp_peers row in a down state, including peers removed long ago (OpenBMP never prunes bgp_peers). They now filter on the peer's last state-change timestamp via $__timeFilter, so the panel reflects current/recent problems rather than all-time history. Co-Authored-By: Claude Opus 4.7 (1M context) --- obmp-grafana/dashboards/General/noc_overview.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/obmp-grafana/dashboards/General/noc_overview.json b/obmp-grafana/dashboards/General/noc_overview.json index cf6f07f..99ee278 100644 --- a/obmp-grafana/dashboards/General/noc_overview.json +++ b/obmp-grafana/dashboards/General/noc_overview.json @@ -45,12 +45,12 @@ }, { "datasource": {"type": "postgres","uid": "obmp_postgres"}, - "description": "BGP peers not up. Investigate any non-zero value.", + "description": "BGP peers that went down within the selected time range. Investigate any non-zero value. (Removed/decommissioned peers fall outside the range and are not counted.)", "fieldConfig": {"defaults": {"color": {"mode": "thresholds"},"thresholds": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "red","value": 1}]},"unit": "short"}}, "gridPos": {"h": 4,"w": 3,"x": 9,"y": 0}, "id": 4, "options": {"colorMode": "background","graphMode": "none","justifyMode": "auto","orientation": "auto","reduceOptions": {"calcs": ["lastNotNull"],"fields": "","values": false},"textMode": "auto"}, - "targets": [{"datasource": {"type": "postgres","uid": "obmp_postgres"},"format": "time_series","rawSql": "SELECT NOW() AS time, count(*) AS \"Peers Down\" FROM bgp_peers WHERE isprepolicy = true AND state != 'up'","refId": "A"}], + "targets": [{"datasource": {"type": "postgres","uid": "obmp_postgres"},"format": "time_series","rawSql": "SELECT NOW() AS time, count(*) AS \"Peers Down\" FROM bgp_peers WHERE isprepolicy = true AND state != 'up' AND $__timeFilter(timestamp)","refId": "A"}], "title": "Peers Down", "type": "stat" }, @@ -132,7 +132,7 @@ }, { "datasource": {"type": "postgres","uid": "obmp_postgres"}, - "description": "Peers not currently up. Empty is healthy. Click a peer to open Peer Detail.", + "description": "Peers that went down within the selected time range. Empty is healthy. Widen the time range to see longer-standing issues. Click a peer to open Peer Detail.", "fieldConfig": { "defaults": {"custom": {"align": "auto","displayMode": "auto"}}, "overrides": [ @@ -144,7 +144,7 @@ "gridPos": {"h": 9,"w": 12,"x": 0,"y": 13}, "id": 11, "options": {"footer": {"countRows": false,"fields": "","reducer": ["sum"],"show": false},"showHeader": true,"sortBy": [{"desc": true,"displayName": "Last Change"}]}, - "targets": [{"datasource": {"type": "postgres","uid": "obmp_postgres"},"format": "table","rawSql": "SELECT\n p.hash_id AS peer_hash_id,\n COALESCE(p.name, p.peer_addr::text) AS \"Peer\",\n p.peer_addr AS \"Address\",\n p.peer_as AS \"AS\",\n p.state AS \"State\",\n p.timestamp AS \"Last Change\",\n p.error_text AS \"Reason\"\nFROM bgp_peers p\nWHERE p.isprepolicy = true AND p.state != 'up'\nORDER BY p.timestamp DESC","refId": "A"}], + "targets": [{"datasource": {"type": "postgres","uid": "obmp_postgres"},"format": "table","rawSql": "SELECT\n p.hash_id AS peer_hash_id,\n COALESCE(p.name, p.peer_addr::text) AS \"Peer\",\n p.peer_addr AS \"Address\",\n p.peer_as AS \"AS\",\n p.state AS \"State\",\n p.timestamp AS \"Last Change\",\n p.error_text AS \"Reason\"\nFROM bgp_peers p\nWHERE p.isprepolicy = true AND p.state != 'up' AND $__timeFilter(p.timestamp)\nORDER BY p.timestamp DESC","refId": "A"}], "title": "Peers Down", "type": "table" },