Skip to content

feat(dashboard): MetricsPanel + wire /api/v1/resources/:id/metrics (W7-F)#55

Merged
mastermanas805 merged 2 commits into
mainfrom
feat/w7f-metrics-dashboard-fresh
May 14, 2026
Merged

feat(dashboard): MetricsPanel + wire /api/v1/resources/:id/metrics (W7-F)#55
mastermanas805 merged 2 commits into
mainfrom
feat/w7f-metrics-dashboard-fresh

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • New MetricsPanel component renders p50/p95/p99 latency, active connections, storage_bytes, and error_rate tiles for a resource. Polls /api/v1/resources/:id/metrics every 60s.
  • getResourceMetrics(id, window) typed client helper in src/api/index.ts.
  • ResourceDetailPage Metrics tab now renders the panel instead of the "awaiting backend" placeholder; ContractLine for /metrics flips from gap to live.
  • Audit early-access CTA preserved (renamed testid audit-early-access) until W7-G ships.
  • Playwright + vitest coverage updated to match the new reality (4 live ContractLines, 1 gap).

Pairs with W7-F-api (POST /api/v1/resources/:id/metrics). If the api half hasn't merged yet, the panel renders an empty-state — not a hard failure.

Test plan

  • npx tsc --noEmit clean
  • npm test — 431 passed, 3 skipped (pre-existing)
  • Manual smoke once W7-F-api lands: visit /app/resources/<id> → Metrics tab → confirm panel renders + stub banner shows

…metrics

W7-F dashboard half. Adds:
- src/components/MetricsPanel.tsx — chart tiles for p50/p95/p99 latency,
  active connections, storage_bytes, error_rate over a tier-capped window.
  Polls /api/v1/resources/:id/metrics every 60s.
- src/api/index.ts — getResourceMetrics(id, window) typed client helper.
- ResourceDetailPage Metrics tab now renders MetricsPanel instead of the
  'awaiting backend' placeholder.
- e2e/resources.spec.ts — Playwright coverage for the Metrics tab rendering
  with a stub data_source banner.

Pairs with W7-F-api (POST /api/v1/resources/:id/metrics). If the api half
isn't merged yet, the panel renders an empty-state — not a hard failure.
W7-F now ships /metrics as status="live" while keeping audit as gap with
its own early-access CTA (testid: audit-early-access). Update the
ContractLine assertions: 4 live rows (was 3), 1 gap row (was 0).
@mastermanas805 mastermanas805 merged commit c4e787b into main May 14, 2026
2 checks passed
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