Commit Graph
2 Commits
Author SHA1 Message Date
Jordi Enric 15fcb7dc49 fix(studio): refresh observability charts for the selected range FE-5122 (#53931)
## Problem

A custom date range in a Storage report URL could show one window in the
header and another in the charts. Refresh also left Database Size and
several Auth charts showing cached results.

## Fix

Use the selected window for all Storage report requests, run the
Database Size query on refresh, and refresh Auth Usage, Errors and
Latency alongside the shared API charts.

## How to test

- Open Storage with a custom start and end time in the URL. Inspect the
chart requests on load and after Refresh. Both sets should use those
exact timestamps.
- Refresh the Database report and check that the large objects query
runs again.
- Open Auth with a fixed range and press Shift+R. The Usage, Errors,
Latency and API charts should request fresh data for the same range.

Fixes [FE-5122](https://linear.app/supabase/issue/FE-5122).
2026-11-24 15:31:11 +01:00
Jordi Enric d6ca0e5900 feat(studio): migrate API reports to OTEL (#50638)
## Problem

The API Gateway and Data API observability reports still send legacy
BigQuery SQL to the logs.all endpoint. The Data API shared-report hook
also hardcodes logs.all, so the otelReports flag cannot move that report
to ClickHouse.

## Fix

- Add the ClickHouse requests-by-country query needed by API Gateway.
- Select API Gateway SQL and endpoint atomically from otelReports.
- Route the Data API PostgREST report through the existing tested OTEL
API query builders and logs.all.otel.
- Wait for ConfigCat before the Data API sends a request, avoiding an
initial legacy request while the flag loads.
- Keep logs.all behavior when the flag is disabled and leave other
shared reports unchanged.

## How to test

1. Enable otelReports and open API Gateway, then confirm its report
requests use logs.all.otel.
2. Open Data API and confirm all report requests use logs.all.otel with
a request.path filter for /rest.
3. Change the date range, add a filter, and refresh each report.
4. Disable otelReports and confirm both reports use logs.all.

All OTEL query shapes were tested individually against logs.all.otel.
The focused query suite and lint pass locally.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - API reports can use OpenTelemetry data when enabled.
- Added country-level request reporting, excluding requests without
country information.
- Added OpenTelemetry-backed PostgREST reports and Storage cache
hit/miss metrics.

- **Improvements**
  - Reports wait for required configuration before loading data.
  - Refreshing reports consistently refetches active metrics.
  - Improved error handling for analytics query failures.
- Improved report accuracy with numeric time buckets and more precise
attribute filtering.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-21 18:13:22 +02:00