2.6 KiB
2.6 KiB
Quickstart: Dashboard Health Windows
Overview
This feature introduces "Execution Windows" for automated LLM dashboard validations, allowing administrators to schedule checks over a period of time (e.g., 1am-5am) rather than at a single exact minute. It also adds a centralized "Health Center" UI to easily monitor which dashboards are currently failing their checks.
Implementation Steps
-
Backend Database Updates:
- Create
ValidationPolicySQLAlchemy model (inbackend/src/models/llm.pyor new file). - Generate Alembic migration for the new table.
- Create
-
Backend API Routes:
- Create CRUD routes for
ValidationPolicy(e.g.,backend/src/api/routes/settings.pyor newautomation.py). - Enhance
backend/src/api/routes/dashboards.py(or createhealth.py) to provide the aggregated health projection (joining Superset dashboard list with the latestValidationRecord).
- Create CRUD routes for
-
Scheduler Integration:
- Implement
ThrottledSchedulerConfiguratorlogic inside or alongsidebackend/src/core/scheduler.py. - Ensure it can parse active
ValidationPolicyrows and translate them into distinctapschedulertriggers spaced evenly across the[window_start, window_end]interval.
- Implement
-
Frontend Settings (Automation):
- Add a new tab/page under Settings for "Automation Policies".
- Implement list view and Create/Edit modal for policies.
- Include intuitive time pickers for the Execution Window.
-
Frontend Health Center:
- Create
/dashboards/healthroute in SvelteKit. - Implement the
HealthMatrixtraffic light summary component. - Build the data table to display the dashboard names, status badges, and issue summaries.
- Create
-
UI Integration:
- Add a derived store to
frontend/src/lib/stores/sidebar.js(or similar) to fetch/calculate the[🔴 N]badge for the Dashboards navigation item. - Update
backend/src/api/routes/assistant.pyso the LLM assistant can answer questions about "failing dashboards" and provide deep links to the new Health Center.
- Add a derived store to
Testing Strategy
- Backend Unit Tests: Verify the math of
ThrottledSchedulerConfigurator(e.g., 60 tasks in 60 minutes = 1 minute intervals). Test boundary conditions (100 tasks in 1 minute). - Backend Route Tests: Verify the API correctly aggregates the latest validation record for the Health Center, ignoring older passing/failing records.
- Frontend Unit Tests: Test
HealthMatrixrendering with different combinations of Pass/Warn/Fail counts. - E2E/Integration: Create a policy, wait for it to schedule, run a mock validation, and verify it appears in the Health Center.