fix: the dashboards drop a dead route filter and a raw counter panel, and the contract test parses PromQL
Summary
Closes #317. Two panels showed nothing useful. "Request Rate by Endpoint" split out /api/v1/result/.*, a route that no longer exists, so one series was always empty. "Partition Message Distribution" plotted a raw counter that drops on every restart, with no partition label. The contract test found metric names with regexes and a 120-word list of PromQL builtins.
[!WARNING]
The label value, legend, unit and unused checks the issue asks for aren't built. No existing tool does them for Grafana dashboards, and we chose not to write our own.
Changes
The rate panel keeps one query per endpoint. The partition panel becomes "Consumer Lag by Group" on kafka_consumer_group_lag_sum_ratio, the name prod already stores. New panels chart receiver metrics nobody read: host load and disk I/O, Kafka consumer group members, MongoDB connections. Receivers keep collecting everything. The contract test parses each query with promql-parser and its walk, and kafka_ joins the collector prefixes. The metrics reference covers the new panels, the uncharted families and the five mongodb rate() panels.
Type of Change
- Bug fix (non-breaking change that fixes an issue)
- New feature (non-breaking change that adds functionality)
- Breaking change (fix or feature that would cause existing functionality to change)
- Documentation update
- Refactoring (no functional changes)
- CI/CD or tooling changes
Test Plan
- Backend unit tests pass (
cd backend && uv run pytest tests/unit) - Frontend unit tests pass (
cd frontend && npm run test) - Backend E2E tests pass (
docker compose exec -T backend sh -c 'uv sync --group test --no-dev --frozen --no-install-project --no-build && pytest tests/e2e') - Frontend E2E tests pass (
cd frontend && npm run test:e2e) - API spec and client regenerated if routes or schemas changed (
./deploy.sh openapi, then./deploy.sh types), never edited by hand - Manual testing performed
Validation: old regexes and promql-parser find the same 127 names in 13 files, and a misspelled name still fails. Every new query returns data on prod VictoriaMetrics, and Grafana 13.2.4 provisions all 12 dashboards. 549 unit tests, 3 contract tests, ruff and strict mypy pass.
Checklist
- My code follows the project's style guidelines
- I have run
pre-commit run --all-filesand all checks pass - I have added tests that prove my fix/feature works
- I have updated documentation if needed
- My changes don't introduce new warnings