Add datasource adapters for telemetry and status #8

Open
opened 2026-06-18 16:12:49 +02:00 by vince · 0 comments
Owner

Parent: #1

Goal

Add the first live-data layer for metrics and service health while keeping datasource definitions in the dashboard model and rendering logic generic.

Scope

  • Define datasource reference types in the model for static values, Prometheus queries, HTTP checks, site monitor badges/status endpoints, and weather/current-condition sources.
  • Implement server-side adapter interfaces for fetching datasource values.
  • Add timeout, cache, stale, unavailable, and error handling states.
  • Normalize metric values, units, thresholds, sparklines, and status severities into renderer-friendly data.
  • Return sparkline/time-series data in a shape that can feed uPlot where richer charting is needed.
  • Support configured fallback values for first-version placeholders.
  • Use msw in tests to mock Prometheus/status/weather APIs without coupling tests to live infrastructure.
  • Add tests/mocks for successful, stale, failed, and partially unavailable datasource responses.

Acceptance criteria

  • Telemetry cards can render live, cached, stale, and unavailable states from adapter results.
  • Service health/status values are resolved through datasource references, not component hardcoding.
  • Adapter failures do not break the whole dashboard.
  • Refresh behavior is configurable through the model or app settings.
  • No secrets or private tokens are exposed to client-side code.
  • Mocked datasource tests cover the main success and failure paths.

Out of scope

  • Full observability backend.
  • Long-term time-series storage.
  • Agent UI for configuring datasources.
Parent: #1 ## Goal Add the first live-data layer for metrics and service health while keeping datasource definitions in the dashboard model and rendering logic generic. ## Scope - Define datasource reference types in the model for static values, Prometheus queries, HTTP checks, site monitor badges/status endpoints, and weather/current-condition sources. - Implement server-side adapter interfaces for fetching datasource values. - Add timeout, cache, stale, unavailable, and error handling states. - Normalize metric values, units, thresholds, sparklines, and status severities into renderer-friendly data. - Return sparkline/time-series data in a shape that can feed `uPlot` where richer charting is needed. - Support configured fallback values for first-version placeholders. - Use `msw` in tests to mock Prometheus/status/weather APIs without coupling tests to live infrastructure. - Add tests/mocks for successful, stale, failed, and partially unavailable datasource responses. ## Acceptance criteria - Telemetry cards can render live, cached, stale, and unavailable states from adapter results. - Service health/status values are resolved through datasource references, not component hardcoding. - Adapter failures do not break the whole dashboard. - Refresh behavior is configurable through the model or app settings. - No secrets or private tokens are exposed to client-side code. - Mocked datasource tests cover the main success and failure paths. ## Out of scope - Full observability backend. - Long-term time-series storage. - Agent UI for configuring datasources.
vince added the
backend
frontend
telemetry
labels 2026-06-18 16:12:49 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: vince/dimensionlab-website#8
No description provided.