## 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)
## Problem
The PostgREST observability page crashes for some projects with
`URIError: URI malformed`. The route renderer calls `decodeURIComponent`
directly on the request query string, which is user-controlled. A
malformed percent-sequence (for example a literal `%` in
`?discount=100%`) makes `decodeURIComponent` throw during render, taking
down the whole page via the global error boundary.
Tracked in Sentry issue 7536581822.
## Fix
Add a `safeDecodeURIComponent` helper that wraps `decodeURIComponent` in
a try/catch and falls back to the raw string on failure. Use it in the
route renderer. The sibling `queryParamsToObject` call is unaffected
since `URLSearchParams` already tolerates malformed escapes.
## How to test
- Open a project's PostgREST observability report
(`/project/[ref]/observability/postgrest`).
- Ensure a request with a malformed query string (e.g. a path containing
a bare `%`) appears in the data.
- Expected result: the row renders with the raw search string instead of
crashing the page.
- Unit tests for `safeDecodeURIComponent` cover valid decode, malformed
input, and empty string.
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* wip
* add formatTimestamp for reports
* add tests for formatTimestamp
* fix type err
* rm old chart logic
* do not retry replication sources
* update report config schema
* use report config
* fix charts, simplify config
* sync charts
* rm comment
* usefilltimeseries
* move chart upsell to its own component
* cleanup v2 chart component
* fix chartheader function format bug
* make attributes dynamic
* move types to its own file
* update reportv2chart types
* update reportv2 chart type
* use new edgefn report
* rm mock
* rm old code
* fix type err
* fix type err
* rename hook
* return sql in dataprovider
* add button to open in log explorer in chart header
* fix type
* fix chart type toggle
* fix type error
* export data transformation for testing
* add tests for data transformation
* rm dupped code
* add report settings to edge fn report
* rm mocked data
* rename
* fix type err
* Apply suggestion from @joshenlim
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* rm unnecessary div
* rm unnecessary props from report upsell
* cleaner query keys
* move loadin/error/empty states to inside panel content to prevent layout shift
* use card instead of panel
* use buttontooltip in chartheader
* use buttontooltips in buttons with tooltips
* rm export default
* rm export defualt
* rm i from key
* fix status code transformation
* fix filltimeseries
* add tests for filltimeseries
* fix data transform
* pass xaxis key to chart
* refactor hover state to use timestamp not index
* fix tests
* fix areachart
* fix barchart
* fix chartheader
* fix composedchart
* fix stacked
* fix type missing xaxiskey
* type fix
* Revert "refactor hover state to use timestamp not index"
This reverts commit cfd7886460.
* undo charthover changes, fix data aggregation
* Revert "fix tests"
This reverts commit e5200a2035.
* move transforms to testable functions, add tests
* nit refactors and clean up
* feat: add aws nimbus cloud provider (#38312)
* feat: add aws nimbus cloud provider
* Fix return type of useCustomContent hook
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* add utc plugin to dayjs
* move plugins to vitest setup
* rm customparser plugin
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>