AI systems require monitoring at two levels: infrastructure (is the system healthy?) and model (is the model still making good predictions?).
| Metric | Description | Alert Threshold |
|---|---|---|
| Latency (p50, p95, p99) | End-to-end inference time | p99 > 500ms for 5min |
| Throughput (req/s) | Requests per second | Sudden drop > 50% |
| Error rate | Non-200 responses / total | > 1% for 2min |
| GPU utilization | Percentage of GPU compute used | > 95% persistent (may need scaling) |
| CPU / Memory | Per-instance resource usage | > 85% for 10min |
| Connection pool usage | DB, Redis, queue connections | > 80% of pool max |
# Drift detection example (Evidently AI)
Feature: "transaction_amount"
Training mean: 125.4, std: 89.2
Serving mean: 178.1, std: 112.5
KS statistic: 0.23 (threshold: 0.1)
→ ALERT: transaction_amount feature has drifted significantly
→ Possible causes: new merchant category, seasonal effect, data pipeline bug
Standard open-source monitoring stack for AI systems:
Trace requests across microservices to identify bottlenecks:
# Trace: single inference request
Span 1: API Gateway → 5ms
Span 2: Auth → 3ms
Span 3: Feature fetch → 22ms (Redis)
Span 4: Feature compute → 15ms
Span 5: Model inference → 87ms (GPU)
Span 6: Post-process → 8ms
Span 7: Log to Kafka → 2ms (async)
Total: ~142ms
# Structured log entry (JSON)
{
"timestamp": "2026-06-15T10:30:00Z",
"request_id": "req_abc123",
"model_id": "fraud-detection-v3",
"latency_ms": 142,
"input_features": {"amount": 299.99, "merchant": "amazon", ...},
"prediction": {"fraud_score": 0.12, "action": "approve"},
"cache_hit": false,
"fallback_used": false
}