Introduction
Alerts notify you when something needs attention. Good alerting catches issues early without causing alert fatigue.
What to Alert On
Symptoms: High error rate, high latency, service down.
NOT Causes: High CPU alone doesn't mean there's a problem.
Prometheus Alerting
yamlgroups: - name: django rules: - alert: HighErrorRate expr: rate(http_responses_total{status="5xx"}[5m]) > 0.1 for: 5m annotations: summary: High error rate detected
Sentry Alerts
pythonimport sentry_sdk sentry_sdk.init( dsn=os.environ['SENTRY_DSN'], traces_sample_rate=0.1, ) # Sentry auto-alerts on new errors
Best Practices
- Alert on symptoms: User-facing impact.
- Avoid noise: Only alert on actionable issues.
- Write runbooks: Document responses.
- Test alerts: Verify they fire correctly.
Summary
Alert on symptoms that affect users, not just causes. Use Prometheus AlertManager or Sentry. Avoid alert fatigue by keeping alerts actionable.