Monitoring Statistics
Page Outline
/api/v1/models/{model_id}/monitoring/statsThe Monitoring Statistics endpoint returns aggregate telemetry and health statistics for a specific model over a defined time window. This comprehensive snapshot is optimized for populating high-level dashboard metrics, exposing critical indicators such as average data drift scores, data quality rates, and overall inference throughput.
[!TIP] For granular, time-series data points spanning these metrics, consider utilizing the Get Alert Rules and configuring dedicated webhooks for real-time anomaly detection rather than polling this endpoint continuously.
Authentication Requirements
This endpoint requires secure authorization via a Bearer token.
- Header:
Authorization: Bearer <Your-JWT-Token> - Permissions Required: The authenticated user must have
model:readororganization:vieweraccess rights for the targeted model.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model_id | string | Yes | The unique identifier (mdl-xxx) of the model whose statistics you are retrieving. |
Query Parameters
You can refine the statistical scope using the following query strings:
| Parameter | Type | Default | Description |
|---|---|---|---|
period | string | 7d | The historical aggregation window. Valid options: 1d (1 day), 7d (7 days), 30d (30 days), and 90d (90 days). |
version_id | string | Latest Promoted | Optional filter to scope statistics to a specific model version (ver-xxx). By default, it aggregates stats for the currently active/promoted version. |
Operational Behavior
When querying the monitoring statistics, the backend performs several aggregations:
- Drift Calculation: The
avg_drift_scorerepresents the mean Population Stability Index (PSI) calculated across all actively monitored features over the selectedperiod. - Data Quality Assessment: The
data_quality_rateis a ratio reflecting the proportion of inference requests that successfully passed schema validation (i.e., no missing required fields or out-of-range numerical values). - Throughput Metrics: The
total_inferencesrepresents the absolute count of prediction requests successfully processed by the inference endpoints within the time window. - Latency Tracking: Evaluates inference speed, providing
avg_latency_msand the 99th percentile (p99_latency_ms).
Response
Upon success, the API responds with an HTTP 200 OK status, returning a MonitoringStats JSON object.
Example JSON Response
{
"model_id": "mdl-7f3a19bc92",
"period": "7d",
"version_id": "ver-001",
"total_inferences": 124870,
"avg_drift_score": 0.082,
"max_drift_score": 0.241,
"data_quality_rate": 0.974,
"active_alerts": 1,
"resolved_alerts": 2,
"avg_latency_ms": 18.4,
"p99_latency_ms": 52.1
}
Error Codes
Implement robust error handling for the following potential failure states:
| Code | Reason | Resolution |
|---|---|---|
400 | Bad Request | You provided an invalid period or malformed version_id. |
401 | Unauthorized | Verify your JWT token format and ensure it has not expired. |
403 | Forbidden | Ensure the user has model:read permissions for the underlying model logic. |
404 | Not Found | The model_id does not exist or falls outside your organization's scope. |
429 | Too Many Requests | Rate limit exceeded. Standard basic backoff procedures apply. |