Interview Prep/Monitoring & Observability/Alerting and On-Call Design

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 →

  1. 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
  1. Add time-lag (seconds behind) if exposed, which maps better to SLOs.
  2. 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."

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Alerting and On-Call Design