Why sample prediction logs and how?
mediumAnswer
- High-volume services (millions QPS) can't log every prediction.
- Sample: (1) uniform 1% for baseline monitoring.
- (2) stratified by class or region for balanced view.
- (3) 100% sample of errors + top-K uncertain predictions (importance sampling for anomalies).
- (4) tail sample: p99 latency requests.
- Storage: sample to cold store (Parquet on S3); realtime metrics from Prometheus counters (not sampled).
- Trade-off: log volume cost vs debug capability.
Check yourself — multiple choice
- Log all
- Uniform 1% baseline + stratified by class/region + 100% of errors + top-K uncertain + tail p99; cold store to Parquet; realtime metrics from Prometheus (not sampled)
- Random
- Not real
Log sampling: uniform + stratified + errors + tail; cold store.
#observability
Practise MLOps & Data Quality
215 interview questions in this topic.