From 26dea47a55c98999d2ad55f63d7424eb027b2b80 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 18 May 2026 22:22:21 -0700 Subject: [PATCH] Make the ASN View origin-AS selector a free-text input asn_num was a fixed custom variable; converting it to a textbox lets an operator look up any origin AS and see all of its RIB prefixes, upstreams, and downstreams. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../dashboards/obmp/Base-1001/asn_view.json | 146 ++++++++++++++---- 1 file changed, 116 insertions(+), 30 deletions(-) diff --git a/obmp-grafana/dashboards/obmp/Base-1001/asn_view.json b/obmp-grafana/dashboards/obmp/Base-1001/asn_view.json index 5e1acf0..b485805 100644 --- a/obmp-grafana/dashboards/obmp/Base-1001/asn_view.json +++ b/obmp-grafana/dashboards/obmp/Base-1001/asn_view.json @@ -27,7 +27,17 @@ "id": null, "iteration": 1654876929746, "links": [ - {"asDropdown": true,"icon": "external link","includeVars": true,"keepTime": true,"tags": ["obmp-nav"],"title": "OBMP Dashboards","type": "dashboards"} + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "obmp-nav" + ], + "title": "OBMP Dashboards", + "type": "dashboards" + } ], "liveNow": false, "panels": [ @@ -39,8 +49,16 @@ "description": "IPv4 vs IPv6 prefix count advertised by this ASN.", "fieldConfig": { "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"hideFrom": {"legend": false,"tooltip": false,"viz": false}}, + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, "decimals": 0, "mappings": [], "unit": "none" @@ -56,23 +74,48 @@ "id": 6, "links": [], "options": { - "displayLabels": ["value"], - "legend": {"calcs": [],"displayMode": "table","placement": "bottom","values": ["value","percent"]}, + "displayLabels": [ + "value" + ], + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "bottom", + "values": [ + "value", + "percent" + ] + }, "pieType": "pie", - "reduceOptions": {"calcs": ["lastNotNull"],"fields": "","values": false}, - "tooltip": {"mode": "single","sort": "none"} + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } }, "pluginVersion": "9.1.7", "targets": [ { - "datasource": {"type": "postgres","uid": "obmp_postgres"}, + "datasource": { + "type": "postgres", + "uid": "obmp_postgres" + }, "alias": "", "format": "time_series", "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as \"ipv4\"\nFROM\n global_ip_rib\nWHERE\n recv_origin_as = [[asn_num]]\n and family(prefix) = 4\nGROUP BY prefix\n", "refId": "A" }, { - "datasource": {"type": "postgres","uid": "obmp_postgres"}, + "datasource": { + "type": "postgres", + "uid": "obmp_postgres" + }, "alias": "", "format": "time_series", "rawSql": "SELECT\n max(timestamp) as time,\n count(*) as \"ipv6\"\nFROM\n global_ip_rib\nWHERE\n recv_origin_as = [[asn_num]]\n and family(prefix) = 6\nGROUP BY prefix\n", @@ -186,8 +229,39 @@ "description": "IPv4/IPv6 prefixes originated by this ASN over time, with RPKI/IRR coverage (from stats_ip_origins).", "fieldConfig": { "defaults": { - "color": {"mode": "palette-classic"}, - "custom": {"axisCenteredZero": false,"axisColorMode": "text","axisLabel": "","axisPlacement": "auto","barAlignment": 0,"drawStyle": "line","fillOpacity": 10,"gradientMode": "none","hideFrom": {"legend": false,"tooltip": false,"viz": false},"lineInterpolation": "linear","lineWidth": 1,"pointSize": 5,"scaleDistribution": {"type": "linear"},"showPoints": "auto","spanNulls": false,"stacking": {"group": "A","mode": "none"},"thresholdsStyle": {"mode": "off"}}, + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, "decimals": 0, "mappings": [], "unit": "none" @@ -203,13 +277,28 @@ "id": 14, "links": [], "options": { - "legend": {"calcs": ["min","max","mean"],"displayMode": "table","placement": "right","showLegend": true}, - "tooltip": {"mode": "multi","sort": "none"} + "legend": { + "calcs": [ + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, "pluginVersion": "9.1.7", "targets": [ { - "datasource": {"type": "postgres","uid": "obmp_postgres"}, + "datasource": { + "type": "postgres", + "uid": "obmp_postgres" + }, "alias": "", "format": "time_series", "rawSql": "SELECT\n $__time(interval_time),\n v4_prefixes,v6_prefixes,v4_with_rpki,v6_with_rpki,v4_with_irr,v6_with_irr\nFROM\n stats_ip_origins\nWHERE\n $__timeFilter(interval_time) and asn = [[asn_num]]\nORDER BY interval_time asc\n", @@ -941,27 +1030,24 @@ "templating": { "list": [ { - "current": { - "selected": false, - "text": "714", - "value": "714" - }, - "hide": 0, - "includeAll": false, - "label": "ASN", - "multi": false, "name": "asn_num", + "type": "textbox", + "label": "Origin AS", + "description": "Enter an origin AS number \u2014 every panel shows that AS's prefixes, upstreams, and downstreams from the BMP RIB.", + "query": "13335", + "current": { + "text": "13335", + "value": "13335" + }, "options": [ { - "selected": true, - "text": "109", - "value": "109" + "text": "13335", + "value": "13335", + "selected": true } ], - "query": "109", - "queryValue": "714", - "skipUrlSync": false, - "type": "custom" + "hide": 0, + "skipUrlSync": false } ] },