Skip to content

Admin: live per-minute API usage monitor (spike detection)#111

Merged
jheller1212 merged 1 commit into
mainfrom
feat/admin-live-usage-monitor
Jun 24, 2026
Merged

Admin: live per-minute API usage monitor (spike detection)#111
jheller1212 merged 1 commit into
mainfrom
feat/admin-live-usage-monitor

Conversation

@jheller1212

Copy link
Copy Markdown
Owner

Answers 'can we see usage spikes in admin?'. The dashboard was day-bucketed — blind to an hour-long workshop.

Edge (workshop-config): new organizer-gated live-usage action. Buckets the last N minutes (default 120) per minute: API calls = assistant messages (each AI turn is one provider call), errors = provider_error events (rate limits/failures). Returns a gap-filled minute series + peak calls/min + totals. Reuses existing data — no new tracking writes.

UI (AdminDashboard): new Live API Usage panel — auto-refreshes every 20s (toggle + manual refresh), shows peak calls/min, 2h totals, and a per-minute bar chart with error-minutes flagged red. Slotted above the daily timeline.

Requires edge redeploy (with --no-verify-jwt). Tests 35/35 ✓, build ✓, lint ✓.

The admin dashboard only bucketed activity by day, useless for an
hour-long workshop. Add a 'live-usage' organizer-only edge action that
buckets the last N minutes (default 120) of API calls (assistant
messages) and provider_error events per minute, and a Live API Usage
panel that auto-refreshes every 20s with peak calls/min, totals, and a
per-minute bar chart (minutes with errors flagged red). Lets the
organizer watch load and rate-limit spikes in near real time.
@jheller1212
jheller1212 merged commit febf2d2 into main Jun 24, 2026
@jheller1212
jheller1212 deleted the feat/admin-live-usage-monitor branch June 24, 2026 19:06
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for ai2aichat ready!

Name Link
🔨 Latest commit c095b2d
🔍 Latest deploy log https://app.netlify.com/projects/ai2aichat/deploys/6a3c2aa46a8a9800082d2273
😎 Deploy Preview https://deploy-preview-111--ai2aichat.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95
Accessibility: 97
Best Practices: 100
SEO: 100
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant