@devries-cameron20 / t3code Mirror · read-only / commits / a84f851055
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 23:15 UTC

fix(relay): relay dashboard latency charts show real durations (#22088)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 19, 2026 at 20:48 UTC a84f851055371663ef2729917a5da53bcc1fc46c
1 file changed +10 -10
infra/relay/src/monitoring.ts
+10 -10
@@ -234,8 +234,8 @@ const relayDashboardCharts = (dataset: string): ReadonlyArray<QueryChart> => {
234 ),
235 timeSeries(
236 "link-latency",
237 - "Link latency (ms, 9 s deadline)",
238 - `${linkRequests}\n| summarize p50 = percentile(duration, 50) / 1000000, p90 = percentile(duration, 90) / 1000000 by bin_auto(_time)`,
237 + "Link latency (9 s deadline)",
238 + `${linkRequests}\n| summarize p50 = percentile(duration, 50), p90 = percentile(duration, 90) by bin_auto(_time)`,
239 ),
240 timeSeries(
241 "reachability",
@@ -254,8 +254,8 @@ const relayDashboardCharts = (dataset: string): ReadonlyArray<QueryChart> => {
254 ),
255 timeSeries(
256 "postgres",
257 - "Postgres query time (ms)",
258 - `${source}\n| where name == "postgres"\n| summarize p50 = percentile(duration, 50) / 1000000, p90 = percentile(duration, 90) / 1000000 by bin_auto(_time)`,
257 + "Postgres query time",
258 + `${source}\n| where name == "postgres"\n| summarize p50 = percentile(duration, 50), p90 = percentile(duration, 90) by bin_auto(_time)`,
259 ),
260 timeSeries(
261 "push",
@@ -292,8 +292,8 @@ const relayDashboardCharts = (dataset: string): ReadonlyArray<QueryChart> => {
292 // and the host's spans. An attempt lasts until initial sync finishes.
293 timeSeries(
294 "connect-time",
295 - "Connecting: time to connected by surface (ms)",
296 - `${clientConnections}\n| summarize p50 = percentile(duration, 50) / 1000000, p90 = percentile(duration, 90) / 1000000 by bin_auto(_time), surface`,
295 + "Connecting: time to connected by surface",
296 + `${clientConnections}\n| summarize p50 = percentile(duration, 50), p90 = percentile(duration, 90) by bin_auto(_time), surface`,
297 ),
298 timeSeries(
299 "connect-outcomes",
@@ -302,7 +302,7 @@ const relayDashboardCharts = (dataset: string): ReadonlyArray<QueryChart> => {
302 ),
303 {
304 id: "connect-phases",
305 - name: "Connecting: where the time goes (ms)",
305 + name: "Connecting: where the time goes",
306 type: "Table",
307 query: {
308 // Failed direct route checks stay in: waiting out an unreachable LAN
@@ -323,15 +323,15 @@ const relayDashboardCharts = (dataset: string): ReadonlyArray<QueryChart> => {
323 ` name == "relay.connection.attempt", "Total: time to connected",`,
324 ` "")`,
325 `| where phase != "" and (error != true or phase startswith "0.")`,
326 - `| summarize calls = count(), p50_ms = round(percentile(duration, 50) / 1000000, 0), p90_ms = round(percentile(duration, 90) / 1000000, 0) by phase`,
326 + `| summarize calls = count(), p50 = percentile(duration, 50), p90 = percentile(duration, 90) by phase`,
327 `| order by phase asc`,
328 ].join("\n"),
329 },
330 },
331 timeSeries(
332 "relay-latency-by-continent",
333 - "Relay token and connect latency by user continent (p50 ms)",
334 - `${source}\n| where kind == "server" and ['attributes.http.request.method'] == "POST" and (['attributes.http.route'] == "/v1/client/dpop-token" or ['attributes.http.route'] == "/v1/environments/:environmentId/connect")\n| extend continent = tostring(['attributes.custom']['relay.edge.continent'])\n| where isnotempty(continent)\n| summarize p50 = percentile(duration, 50) / 1000000 by bin_auto(_time), continent`,
333 + "Relay token and connect latency by user continent (p50)",
334 + `${source}\n| where kind == "server" and ['attributes.http.request.method'] == "POST" and (['attributes.http.route'] == "/v1/client/dpop-token" or ['attributes.http.route'] == "/v1/environments/:environmentId/connect")\n| extend continent = tostring(['attributes.custom']['relay.edge.continent'])\n| where isnotempty(continent)\n| summarize p50 = percentile(duration, 50) by bin_auto(_time), continent`,
335 ),
336 ];
337 };