Design alerting for Kafka consumer lag without false positives during traffic bursts.
IntermediateScenarioAlerting and On-Call Design
Answer
Situation read → Absolute lag is misleading: 1M messages behind with a fast consumer clears in seconds, 1000 behind with a stuck consumer never clears.
What I'd do →
- Alert on lag that is not decreasing, not lag size. With kafka_exporter or Burrow-style metrics:
expr: |
sum by (consumergroup, topic) (kafka_consumergroup_lag) > 10000
and
deriv(sum by (consumergroup, topic) (kafka_consumergroup_lag)[15m:1m]) >= 0
for: 15m
- Add time-lag (seconds behind) if exposed, which maps better to SLOs.
- Alert if consumption rate is zero while lag exists.
Why → Growth or stagnation means consumers cannot keep up. A shrinking backlog is a recovering system.
Interview tip → Say "I alert on lag trend and time-lag, not the raw count."
More on Alerting and On-Call Design
Your on-call engineers receive 300 alerts a night and have started ignoring the pager. How do you fix it?IntermediateYou are asked to design alerting for a brand-new HTTP service from scratch. What do you alert on?BeginnerA "CPU above 90%" alert wakes someone at 3 a.m., but users saw no impact. What do you change?BeginnerA new hire asks: "Should we page on symptoms or causes?" How do you answer with an example?BeginnerDesign burn-rate alerts for a 99.9% availability SLO over 30 days.AdvancedPayments and platform teams share one Prometheus and one Alertmanager. How do you route alerts to the right team and severity?Intermediate