From f470b3c3cde10495fb689f2c4fc96f0508be61b4 Mon Sep 17 00:00:00 2001 From: ryzrr Date: Tue, 21 Jul 2026 23:07:40 +0530 Subject: [PATCH 1/2] refactor: replace mock data with real metrics across the dashboard Removes lib/mock-data.ts and the pipelines demo page/components, and wires every chart, hook, and route to honest empty states instead of fallback mock data. Also fixes timeseries bucket zero-filling and per-minute rate normalization, widens the traces window to match the time-range picker, and refreshes project access checks to query membership live instead of trusting a cached session list. --- app/(dashboard)/alerts/page.tsx | 40 +- app/(dashboard)/endpoints/page.tsx | 22 +- app/(dashboard)/overview/page.tsx | 40 +- app/(dashboard)/pipelines/page.tsx | 112 ------ app/(dashboard)/traces/page.tsx | 36 +- app/api/lb/[...path]/route.ts | 11 +- app/api/realtime-token/route.ts | 8 +- app/auth/signin/page.tsx | 12 +- apps/api/api/routes/query.py | 127 +++++-- apps/api/api/schemas.py | 8 +- apps/api/worker/metrics.py | 12 +- auth.ts | 14 +- components/alerts/rule-list.tsx | 13 +- components/auth/user-menu.tsx | 8 +- components/charts/empty-chart-state.tsx | 12 + components/charts/error-rate-chart.tsx | 16 +- components/charts/latency-histogram.tsx | 4 +- components/charts/requests-chart.tsx | 16 +- components/dashboard/active-pipeline.tsx | 154 -------- components/dashboard/incident-panel.tsx | 10 +- components/dashboard/live-log-table.tsx | 128 ++++--- .../dashboard/pipeline-architecture.tsx | 124 ------ components/dashboard/stat-card.tsx | 6 +- components/endpoints/endpoint-comparison.tsx | 18 +- components/endpoints/endpoint-drawer.tsx | 18 +- components/endpoints/endpoint-table.tsx | 13 +- components/layout/sidebar.tsx | 2 - components/layout/time-range-picker.tsx | 26 +- components/layout/topbar.tsx | 12 +- components/projects/create-project-dialog.tsx | 16 +- components/status/uptime-bar.tsx | 6 +- components/traces/flame-graph.tsx | 10 +- components/traces/service-map.tsx | 6 +- components/traces/span-detail.tsx | 8 +- hooks/use-api-query.ts | 33 +- hooks/use-data.ts | 56 ++- hooks/use-live-metrics.ts | 95 ++--- hooks/use-time-range.ts | 1 + hooks/use-websocket.ts | 129 ++++--- lib/mock-data.ts | 358 ------------------ lib/project-access.ts | 27 ++ lib/socket.ts | 3 + lib/types.ts | 2 +- lib/utils.ts | 16 + proxy.ts | 5 +- types/next-auth.d.ts | 3 - 46 files changed, 627 insertions(+), 1169 deletions(-) delete mode 100644 app/(dashboard)/pipelines/page.tsx create mode 100644 components/charts/empty-chart-state.tsx delete mode 100644 components/dashboard/active-pipeline.tsx delete mode 100644 components/dashboard/pipeline-architecture.tsx delete mode 100644 lib/mock-data.ts create mode 100644 lib/project-access.ts diff --git a/app/(dashboard)/alerts/page.tsx b/app/(dashboard)/alerts/page.tsx index acd47e4..c7f7ea1 100644 --- a/app/(dashboard)/alerts/page.tsx +++ b/app/(dashboard)/alerts/page.tsx @@ -84,11 +84,11 @@ function ChannelConfigForm({ channel, onSave, onTest, onDelete, onClose }: { {CHANNEL_ICON[channel.type]} {channel.name} - +
-