feat(dashboard): MetricsPanel + wire /api/v1/resources/:id/metrics (W7-F)#55
Merged
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MetricsPanelcomponent renders p50/p95/p99 latency, active connections, storage_bytes, and error_rate tiles for a resource. Polls/api/v1/resources/:id/metricsevery 60s.getResourceMetrics(id, window)typed client helper insrc/api/index.ts.ResourceDetailPageMetrics tab now renders the panel instead of the "awaiting backend" placeholder; ContractLine for/metricsflips fromgaptolive.audit-early-access) until W7-G ships.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 --noEmitcleannpm test— 431 passed, 3 skipped (pre-existing)/app/resources/<id>→ Metrics tab → confirm panel renders + stub banner shows