Skip to content

[FEATURE] Model Monitoring API — Serve live model metrics and predictions statistics #236

@gelluisaac

Description

@gelluisaac

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions