| name | deploy_monitoring |
| description | Health checks, metrics, alerting ve rollback stratejileri. |
📊 Deploy Monitoring
Monitoring, alerting ve rollback stratejileri.
❤️ Health Checks
app.get('/health', (req, res) => {
res.json({ status: 'healthy', version: process.env.APP_VERSION });
});
app.get('/ready', async (req, res) => {
await db.$queryRaw`SELECT 1`;
res.json({ status: 'ready' });
});
📈 Metrics (Prometheus)
const httpDuration = new Histogram({
name: 'http_request_duration_seconds',
help: 'Duration of HTTP requests',
labelNames: ['method', 'route', 'status'],
});
🚨 Alert Rules
- alert: HighErrorRate
expr: rate(http_requests_total{status=~"5.."}[5m]) > 0.05
for: 5m
labels:
severity: critical
⏪ Rollback
kubectl rollout undo deployment/app
vercel rollback
🔄 Workflow
Kaynak: Google SRE Book - Monitoring & Prometheus Best Practices
Aşama 1: Observability Instrumentation
Aşama 2: SLI/SLO & Alerting Setup
Aşama 3: Analysis & Incident Response
Kontrol Noktaları
| Aşama | Doğrulama |
|---|
| 1 | Yeni bir servis eklendiğinde monitoring otomatik devreye giriyor mu? |
| 2 | Alertler "aksiyon alınabilir" (Actionable) bilgi içeriyor mu? |
| 3 | Loglarda PII (Kişisel veri) maskeleniyor mu? |
Deploy Monitoring v1.5 - With Workflow