8000 ui/admin: add Response Metrics page by AlameerAshraf · Pull Request #4618 · target/goalert · GitHub
[go: up one dir, main page]

Skip to content

ui/admin: add Response Metrics page - #4618

Open
AlameerAshraf wants to merge 4 commits into
target:masterfrom
AlameerAshraf:feat/admin-response-metrics
Open

AlameerAshraf wants to merge 4 commits into
target:masterfrom
AlameerAshraf:feat/admin-response-metrics

Conversation

@AlameerAshraf
@AlameerAshraf AlameerAshraf commented Nov 7, 2026 •
Copy link
Copy Markdown

Summary

Adds Admin → Response Metrics (/admin/response-metrics), a cross-service view of how quickly alerts are acknowledged and closed.

Today response times are only visible per service (Services → Alert Metrics). Teams running on-call across several services don't have a single place to answer "how fast do we respond overall, and where are we slow?". This page fills that gap using the alert metrics GoAlert already records (timeToAck, timeToClose, escalated), so there are no backend, schema or config changes. It reuses the existing useAlerts hook from the Alert Metrics page.

What's on the page (past 7 / 30 / 90 days)

  • Summary cards: alert count, open/unacknowledged, median and p90 time to ack, median and p90 time to close, % of closed alerts that escalated, number of services with alerts
  • Time to Acknowledge: distribution of closed alerts (< 1 min, 1–5, 5–15, 15–30, 30–60 min, 1–4 h, > 4 h)
  • Response by Service: per-service alerts, closed, escalation rate, median time to ack and close, busiest first; each service links to its existing Alert Metrics page

The time range is kept in the URL (?range=P7D|P30D|P90D), like the other admin metrics pages.

Notes

  • Time-based metrics only cover closed alerts, since that's when GoAlert computes them; the UI says so.
  • Charts follow the existing admin metrics style (Recharts + AutoSizer, theme colours), so they pick up the user's theme and light/dark mode.
  • No existing behaviour changes; the page is additive and only reachable from the Admin menu.

Screenshots

Local build with sample data (58 alerts across 4 services over 30 days).

Light Dark
Response Metrics, light, summary and chart Response Metrics, dark, summary and chart
Response Metrics, light, per-service table Response Metrics, dark, per-service table

Testing

  • Unit tests for the calculations in web/src/app/admin/admin-response-metrics/util.test.ts (percentiles, ack distribution, per-service grouping, formatting): jest passes.
  • bun run check (tsc for app and cypress), eslint and prettier pass on the changed files.
  • Manually verified against a local build with sample services and alerts (light and dark mode, range switching, service links).
  • Added a Cypress test in web/src/cypress/e2e/admin.cy.ts (page renders, per-service table, range selector). I haven't been able to run the Cypress suite locally, so I'd appreciate CI confirming it.

Happy to open a tracking issue first or adjust scope (e.g. split the page or move it) if you'd prefer.

@github-actions github-actions Bot added the size/l label Nov 7, 2026
Adds Admin > Response Metrics, a cross-service view of how quickly alerts
are acknowledged and closed. It builds on the existing alert metrics
(timeToAck, timeToClose, escalated) already used by the per-service
Alert Metrics page, so no backend or schema changes are needed.

The page shows, for the past 7/30/90 days:
- summary cards: alert count, open/unacknowledged, median and p90 time to
  ack and time to close, and the share of closed alerts that escalated
- a time-to-acknowledge distribution
- alerts by hour of day (local time)
- a per-service table with alert counts, escalation rate and median
  response times, linking to each service's Alert Metrics page

Calculations live in util.ts with unit tests; a Cypress test covers the
page and the time range selector.

Signed-off-by: Alameer Ashraf <alamiir.ashraf@gmail.com>
Use compact bucket labels (e.g. "5–15m", "1–4h") and render every
x-axis tick on the time-to-acknowledge chart so no bucket goes unlabeled.

Signed-off-by: Alameer Ashraf <alamiir.ashraf@gmail.com>
Drop the alerts-by-hour chart and simplify the page, graph and tests to keep the change focused.

Signed-off-by: Alameer Ashraf <alamiir.ashraf@gmail.com>
@AlameerAshraf
AlameerAshraf force-pushed the feat/admin-response-metrics branch from 172ed8f to 0cfca68 Compare November 7, 2026 12:22
Give the per-service table the full width so service names and column headers don't wrap.

Signed-off-by: Alameer Ashraf <alamiir.ashraf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0