Building API Auth Observability Screens
Use this page to build a real customer-facing observability section for API Auth, not an internal checklist.What to build
- A
Logstable for per-request audit entries. - An
Analyticssummary for top keys, top paths, blocked reasons. - A
Timeserieschart for trend monitoring. - A triage panel with one-click rotate/revoke actions.
Step 1: build logs table with filters
UseuseApiAuthAuditLogs with cursor and filter options.
limitcursoroutcomekey_idstart_dateend_date
Step 2: build analytics cards
UseuseApiAuthAuditAnalytics for aggregate insights.
- Total requests.
- Allowed vs blocked.
- Top 5 keys by traffic.
- Top blocked reasons.
Step 3: add trend chart
UseuseApiAuthAuditTimeseries.
hourfor 24h/48h.dayfor 7-30 days.
Step 4: connect logs to key actions
When operator clicks a suspicious key in logs/analytics:- Open key details.
- Show recent events for that key.
- Provide
RotateandRevokeactions.
Step 5: make the screen usable in production
- Save filters in URL query params.
- Poll or refetch every 30-60 seconds for active incidents.
- Render explicit empty state when no logs match filters.
- Show clear error banners for failed analytics queries.
Related docs
- React Router
useApiAuthAuditLogs - React Router
useApiAuthAuditAnalytics - React Router
useApiAuthAuditTimeseries - React Router
useApiAuthKeys - API Keys Backend API Reference
Validation checklist
- Filters in logs table match backend query behavior.
- Analytics totals and timeseries window align for same date range.
- Rotate/revoke actions refresh logs and analytics state.
- Unauthorized users cannot access audit routes.
