From 1acdc32dda737b8fbafefc2aed299e9c25700653 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 19 May 2026 00:20:09 -0700 Subject: [PATCH] Fix LS Topology map double-quoted protocol variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The protocol variable has includeAll enabled, so Grafana auto-quotes its value ('IS-IS_L2'); the SQL then wrapped it again, producing ''IS-IS_L2'' and a syntax error that blanked the node graph. Replace the quoted equality filter with IN ($protocol) — Grafana already emits a quoted CSV — and make the variable multi-select so "All" expands cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) --- obmp-grafana/dashboards/obmp/Maps-1006/ls_topo.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obmp-grafana/dashboards/obmp/Maps-1006/ls_topo.json b/obmp-grafana/dashboards/obmp/Maps-1006/ls_topo.json index c5fe65f..ec4059c 100644 --- a/obmp-grafana/dashboards/obmp/Maps-1006/ls_topo.json +++ b/obmp-grafana/dashboards/obmp/Maps-1006/ls_topo.json @@ -25,13 +25,13 @@ { "datasource": {"type": "postgres","uid": "obmp_postgres"}, "format": "table", - "rawSql": "SELECT n.hash_id::text AS id,\n CASE WHEN COALESCE(n.name,'') = '' THEN n.igp_router_id ELSE n.name END AS title,\n n.router_id AS mainstat,\n n.protocol::text AS secondarystat,\n n.igp_router_id AS detail__igp_id,\n 'AS ' || n.asn AS detail__asn,\n COALESCE(NULLIF(n.sr_capabilities,''),'none') AS detail__sr_caps,\n CASE WHEN COALESCE(n.sr_capabilities,'') <> '' THEN 1 ELSE 0 END AS arc__sr,\n CASE WHEN COALESCE(n.sr_capabilities,'') = '' THEN 1 ELSE 0 END AS arc__plain\nFROM ls_nodes n\nWHERE n.iswithdrawn = false\n AND n.peer_hash_id = '$peer_hash'\n AND ('$protocol' = '' OR n.protocol::text = '$protocol')\n AND ($asn = 0 OR n.asn = $asn)\nORDER BY title", + "rawSql": "SELECT n.hash_id::text AS id,\n CASE WHEN COALESCE(n.name,'') = '' THEN n.igp_router_id ELSE n.name END AS title,\n n.router_id AS mainstat,\n n.protocol::text AS secondarystat,\n n.igp_router_id AS detail__igp_id,\n 'AS ' || n.asn AS detail__asn,\n COALESCE(NULLIF(n.sr_capabilities,''),'none') AS detail__sr_caps,\n CASE WHEN COALESCE(n.sr_capabilities,'') <> '' THEN 1 ELSE 0 END AS arc__sr,\n CASE WHEN COALESCE(n.sr_capabilities,'') = '' THEN 1 ELSE 0 END AS arc__plain\nFROM ls_nodes n\nWHERE n.iswithdrawn = false\n AND n.peer_hash_id = '$peer_hash'\n AND n.protocol::text IN ($protocol)\n AND ($asn = 0 OR n.asn = $asn)\nORDER BY title", "refId": "nodes" }, { "datasource": {"type": "postgres","uid": "obmp_postgres"}, "format": "table", - "rawSql": "SELECT l.local_node_hash_id::text || '->' || l.remote_node_hash_id::text AS id,\n l.local_node_hash_id::text AS source,\n l.remote_node_hash_id::text AS target,\n MAX(l.igp_metric)::bigint AS mainstat,\n MAX(l.protocol::text) AS secondarystat,\n MAX(l.te_def_metric)::text AS detail__te_metric,\n MAX(l.max_link_bw)::text AS detail__max_bw\nFROM ls_links l\nJOIN ls_nodes ln ON ln.hash_id = l.local_node_hash_id AND ln.peer_hash_id = l.peer_hash_id\nWHERE l.iswithdrawn = false\n AND l.peer_hash_id = '$peer_hash'\n AND ('$protocol' = '' OR l.protocol::text = '$protocol')\n AND ($asn = 0 OR ln.asn = $asn)\nGROUP BY l.local_node_hash_id, l.remote_node_hash_id", + "rawSql": "SELECT l.local_node_hash_id::text || '->' || l.remote_node_hash_id::text AS id,\n l.local_node_hash_id::text AS source,\n l.remote_node_hash_id::text AS target,\n MAX(l.igp_metric)::bigint AS mainstat,\n MAX(l.protocol::text) AS secondarystat,\n MAX(l.te_def_metric)::text AS detail__te_metric,\n MAX(l.max_link_bw)::text AS detail__max_bw\nFROM ls_links l\nJOIN ls_nodes ln ON ln.hash_id = l.local_node_hash_id AND ln.peer_hash_id = l.peer_hash_id\nWHERE l.iswithdrawn = false\n AND l.peer_hash_id = '$peer_hash'\n AND l.protocol::text IN ($protocol)\n AND ($asn = 0 OR ln.asn = $asn)\nGROUP BY l.local_node_hash_id, l.remote_node_hash_id", "refId": "edges" } ], @@ -67,7 +67,7 @@ "hide": 0, "includeAll": true, "label": "IGP Protocol", - "multi": false, + "multi": true, "name": "protocol", "options": [], "query": "SELECT DISTINCT protocol::text FROM ls_nodes WHERE iswithdrawn=false AND protocol IS NOT NULL AND protocol::text <> '' ORDER BY 1",