mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem On the edge functions report, the Edge Function Status Codes chart shows a single combined count in its header, which is hard to read when responses include errors. The count would be more intuitive if it were broken down by status code. Resolves FE-4025. ## Solution Add **Warnings** (4xx) and **Errors** (5xx) counts to the right of the total in the chart header. This matches the request cards on the project home page, and uses the same warning and error definitions as the Logs Explorer filters. Per-code detail stays in the legend and tooltip. - The counts show the period totals by default and follow the hovered point, like the total does. - Charts opt in through a new optional `getHeaderStats` on `ReportConfig`, passed through `ReportChartV2` and `ComposedChart` to `ChartHeader`. Only the status codes report sets it, so other reports are unchanged. - The counts are summed from the existing pivoted status code series (`getStatusClassCounts`), so the log queries are untouched and both the BigQuery and otel paths work. - The chart's info tooltip now explains what warnings and errors mean. <img width="756" height="305" alt="Image" src="https://github.com/user-attachments/assets/808085f5-abd9-43ec-903b-dfa0d5e4f598" /> ## Review instructions 1. Run Studio and open **Observability → Edge Functions** for a project that has edge function traffic. 2. On the **Edge Function Status Codes** chart, check that **Warnings** and **Errors** appear next to the total, and that they match the 4xx and 5xx rows in the legend. 3. Hover the chart. The total, Warnings and Errors should all follow the hovered point, then return to the period totals when you move away. 4. Check that **Total Edge Function Invocations**, **Execution Time** and **Invocations by Region** show no Warnings or Errors. 5. Try a narrow viewport to check the header doesn't crowd the buttons. Unit tests cover the counting and the header (period totals, hover, and charts without stats): `pnpm exec vitest run components/interfaces/Reports components/ui/Charts`. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)