Description
Create endpoints that serve model performance metrics and drift detection data
for the ModelMonitoringDashboard frontend component.
Endpoints
GET /api/v1/monitoring/metrics — Latest model metrics (accuracy, F1, AUC, drift score)
GET /api/v1/monitoring/performance-history?days=30 — Time series of metrics
GET /api/v1/monitoring/drift-report — Feature drift analysis report
GET /api/v1/monitoring/prediction-stats — Prediction volume and distribution stats
GET /api/v1/monitoring/latency — API latency percentiles (p50, p95, p99)
Implementation Details
- Store metric snapshots in a
ModelMetrics database table
- Periodically compute metrics from logged predictions (via background task)
- Drift detection using existing
astroml/validation/ modules
Acceptance Criteria
- Metrics endpoint returns data compatible with
ModelMonitoringDashboard.tsx
- Performance history returns at least 30 data points
- Latency endpoint exposes realistic percentile values
- Empty/not-yet-trained models return informative defaults, not errors
Labels
enhancement, api, monitoring, ml
Description
Create endpoints that serve model performance metrics and drift detection data
for the ModelMonitoringDashboard frontend component.
Endpoints
GET /api/v1/monitoring/metrics— Latest model metrics (accuracy, F1, AUC, drift score)GET /api/v1/monitoring/performance-history?days=30— Time series of metricsGET /api/v1/monitoring/drift-report— Feature drift analysis reportGET /api/v1/monitoring/prediction-stats— Prediction volume and distribution statsGET /api/v1/monitoring/latency— API latency percentiles (p50, p95, p99)Implementation Details
ModelMetricsdatabase tableastroml/validation/modulesAcceptance Criteria
ModelMonitoringDashboard.tsxLabels
enhancement,api,monitoring,ml