From 6496b60311544633c9a6c1633938ff45fbebaaa8 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 19 May 2026 08:00:50 -0700 Subject: [PATCH] Make L3VPN RD/VRF filter dynamic (roadmap E4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both L3VPN dashboards had a static custom 'rd' variable holding only the '-' (all) sentinel — you could not actually filter by a VRF. Convert 'rd' to a query variable that discovers route distinguishers from l3vpn_rib. Degrades cleanly on the (currently empty) lab table: the query always returns '-', so behaviour is unchanged until real L3VPN data exists, then RDs auto-populate. Existing panel SQL ('$rd' = '-' OR rd = '$rd') is untouched. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../obmp/L3VPN-1005/l3vpn_prefix_hist.json | 35 ++++++++++--------- .../obmp/L3VPN-1005/l3vpn_rib_browser.json | 32 ++++++++--------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_prefix_hist.json b/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_prefix_hist.json index 33edaf5..9669c93 100644 --- a/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_prefix_hist.json +++ b/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_prefix_hist.json @@ -645,27 +645,28 @@ "type": "query" }, { + "name": "rd", + "type": "query", + "label": "RD", + "description": "Route Distinguisher (VRF). Auto-discovered from l3vpn_rib; '-' = all VRFs.", + "datasource": { + "type": "postgres", + "uid": "obmp_postgres" + }, + "query": "SELECT '-' AS rd UNION SELECT DISTINCT rd FROM l3vpn_rib WHERE iswithdrawn = false ORDER BY rd", + "definition": "SELECT '-' AS rd UNION SELECT DISTINCT rd FROM l3vpn_rib WHERE iswithdrawn = false ORDER BY rd", + "refresh": 1, + "includeAll": false, + "multi": false, "current": { - "selected": false, + "selected": true, "text": "-", "value": "-" }, - "description": "RD in the format of N:N. Set to - for all.", + "options": [], + "sort": 1, "hide": 0, - "includeAll": false, - "label": "RD", - "multi": false, - "name": "rd", - "options": [ - { - "selected": true, - "text": "-", - "value": "-" - } - ], - "query": "-", - "skipUrlSync": false, - "type": "custom" + "skipUrlSync": false } ] }, @@ -703,4 +704,4 @@ "uid": "l3vpn-prefix-hist", "version": 2, "weekStart": "" -} \ No newline at end of file +} diff --git a/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_rib_browser.json b/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_rib_browser.json index 25a44b2..b0666d2 100644 --- a/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_rib_browser.json +++ b/obmp-grafana/dashboards/obmp/L3VPN-1005/l3vpn_rib_browser.json @@ -1067,28 +1067,28 @@ "useTags": false }, { + "name": "rd", + "type": "query", + "label": "RD", + "description": "Route Distinguisher (VRF). Auto-discovered from l3vpn_rib; '-' = all VRFs.", + "datasource": { + "type": "postgres", + "uid": "obmp_postgres" + }, + "query": "SELECT '-' AS rd UNION SELECT DISTINCT rd FROM l3vpn_rib WHERE iswithdrawn = false ORDER BY rd", + "definition": "SELECT '-' AS rd UNION SELECT DISTINCT rd FROM l3vpn_rib WHERE iswithdrawn = false ORDER BY rd", + "refresh": 1, + "includeAll": false, + "multi": false, "current": { "selected": true, "text": "-", "value": "-" }, - "description": "RD in the format of N:N. Set to - for all.", + "options": [], + "sort": 1, "hide": 0, - "includeAll": false, - "label": "RD", - "multi": false, - "name": "rd", - "options": [ - { - "selected": true, - "text": "-", - "value": "-" - } - ], - "query": "-", - "queryValue": "203:20", - "skipUrlSync": false, - "type": "custom" + "skipUrlSync": false }, { "current": {