From 7fcba76c0f2404c7709c68f34deb02fcf642a47a Mon Sep 17 00:00:00 2001 From: Hassan Abdel-Rahman Date: Wed, 13 May 2026 14:12:21 -0400 Subject: [PATCH 1/2] observability: Concurrent Users list + Synapse panel polish - Split the Concurrent Users stat into two stacked panels: the existing big-number stat (with sparkline) on top, and a headerless list of the Matrix user IDs in the rolling 5-minute window below. Each user is a data link to the Users dashboard with `var-matrix_user_id` pre-set, so clicking a name lands on that user's credit/permission view. - Retarget both Concurrent Users panel links from the Synapse dashboard to the Users dashboard. - Stretch the Synapse process bar gauge (CPU / Mem) from h:4 to h:7 so it matches the neighbouring Postgres DB stat and closes the gap below it. - Shrink the Synapse process bar gauge title / value font sizes (~25% smaller than auto) so they sit more proportionally next to the rest of the bottom row. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../dashboards/boxel-status/overview.json | 136 +++++++++++++++++- 1 file changed, 130 insertions(+), 6 deletions(-) diff --git a/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json b/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json index 107eba7063f..f96f9aebe62 100644 --- a/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json +++ b/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json @@ -248,8 +248,8 @@ "decimals": 0, "links": [ { - "title": "Open Synapse dashboard", - "url": "/d/000000012", + "title": "Open Users dashboard", + "url": "/d/boxelusers0001", "targetBlank": false } ], @@ -288,7 +288,7 @@ ] }, "gridPos": { - "h": 8, + "h": 5, "w": 8, "x": 16, "y": 0 @@ -296,8 +296,8 @@ "id": 30, "links": [ { - "title": "Open Synapse dashboard", - "url": "/d/000000012", + "title": "Open Users dashboard", + "url": "/d/boxelusers0001", "targetBlank": false, "type": "link", "icon": "external link" @@ -334,6 +334,126 @@ "title": "Concurrent Users", "type": "stat" }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "description": "Matrix user IDs seen on the Synapse Sliding Sync endpoint within the last 5 minutes. Click a user to open the Users dashboard focused on them.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false, + "minWidth": 120 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "transparent", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "user" + }, + "properties": [ + { + "id": "displayName", + "value": "Matrix User" + }, + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#ff66c4" + } + }, + { + "id": "links", + "value": [ + { + "title": "Open in Users dashboard", + "url": "/d/boxelusers0001?${__url_time_range}&var-matrix_user_id=${__value.text}", + "targetBlank": false + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 3, + "w": 8, + "x": 16, + "y": 5 + }, + "id": 31, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": false, + "sortBy": [ + { + "desc": false, + "displayName": "Matrix User" + } + ] + }, + "pluginVersion": "12.4.3", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "expr": "sum by (user) (count_over_time({service=\"synapse\"} |~ \"Processed request.*simplified_msc3575/sync\" | regexp `\\{(?P@[^}]+:[^}]+)\\}` [5m]))", + "queryType": "instant", + "legendFormat": "{{user}}", + "refId": "A" + } + ], + "title": "", + "transformations": [ + { + "id": "labelsToFields", + "options": { + "mode": "columns" + } + }, + { + "id": "filterFieldsByName", + "options": { + "include": { + "pattern": "^user$" + } + } + } + ], + "type": "table" + }, { "datasource": { "type": "loki", @@ -2096,7 +2216,7 @@ ] }, "gridPos": { - "h": 4, + "h": 7, "w": 4, "x": 16, "y": 16 @@ -2112,6 +2232,10 @@ "minVizHeight": 10, "maxVizHeight": 300, "sizing": "auto", + "text": { + "titleSize": 22, + "valueSize": 21 + }, "reduceOptions": { "calcs": [ "lastNotNull" From 3505ea75591fa161bd2963408436ccaafac03e30 Mon Sep 17 00:00:00 2001 From: Hassan Abdel-Rahman Date: Wed, 13 May 2026 14:23:43 -0400 Subject: [PATCH 2/2] observability: address Copilot review on Concurrent Users - URL-encode the Matrix user ID in the per-user data link using the `:percentencode` formatter, so users with `@`, `:`, `+` or other reserved chars produce a valid query string. - Preserve the dashboard time range on the two panel-level "Open Users dashboard" links, matching the per-user data link behaviour. - Swap the `|~ "Processed request.*simplified_msc3575/sync"` regex filter in both Loki queries for two `|=` substring filters, which Loki evaluates much faster than a regex match. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../resources/dashboards/boxel-status/overview.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json b/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json index f96f9aebe62..ff47bb9706a 100644 --- a/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json +++ b/packages/observability/grafanactl/resources/dashboards/boxel-status/overview.json @@ -249,7 +249,7 @@ "links": [ { "title": "Open Users dashboard", - "url": "/d/boxelusers0001", + "url": "/d/boxelusers0001?${__url_time_range}", "targetBlank": false } ], @@ -297,7 +297,7 @@ "links": [ { "title": "Open Users dashboard", - "url": "/d/boxelusers0001", + "url": "/d/boxelusers0001?${__url_time_range}", "targetBlank": false, "type": "link", "icon": "external link" @@ -325,7 +325,7 @@ "type": "loki", "uid": "loki" }, - "expr": "count(count by (user) (count_over_time({service=\"synapse\"} |~ \"Processed request.*simplified_msc3575/sync\" | regexp `\\{(?P@[^}]+:[^}]+)\\}` [5m]))) or vector(0)", + "expr": "count(count by (user) (count_over_time({service=\"synapse\"} |= \"Processed request\" |= \"simplified_msc3575/sync\" | regexp `\\{(?P@[^}]+:[^}]+)\\}` [5m]))) or vector(0)", "queryType": "range", "legendFormat": "Concurrent Users", "refId": "A" @@ -388,7 +388,7 @@ "value": [ { "title": "Open in Users dashboard", - "url": "/d/boxelusers0001?${__url_time_range}&var-matrix_user_id=${__value.text}", + "url": "/d/boxelusers0001?${__url_time_range}&var-matrix_user_id=${__value.text:percentencode}", "targetBlank": false } ] @@ -429,7 +429,7 @@ "type": "loki", "uid": "loki" }, - "expr": "sum by (user) (count_over_time({service=\"synapse\"} |~ \"Processed request.*simplified_msc3575/sync\" | regexp `\\{(?P@[^}]+:[^}]+)\\}` [5m]))", + "expr": "sum by (user) (count_over_time({service=\"synapse\"} |= \"Processed request\" |= \"simplified_msc3575/sync\" | regexp `\\{(?P@[^}]+:[^}]+)\\}` [5m]))", "queryType": "instant", "legendFormat": "{{user}}", "refId": "A"