Lag Compensation refreshes watermark offsets and consumer lag for long-paused partitions, so dashboards, alerts, and the Web UI keep reporting accurate lag instead of a frozen value while a partition is paused. !!! info "Lag Compensation Is a Karafka Pro Feature" Lag Compensation is part of [Karafka Pro](https://karafka.io/#become-pro). ## The Problem It Solves `librdkafka` updates watermark offsets and consumer lag only from fetch responses. A paused partition does not fetch, so once it has stayed paused for a while, its watermark offset and `consumer_lag` values stop changing in `statistics.emitted` and remain frozen for as long as the pause lasts. Any dashboard, alert, or Web UI view built on those values then shows stale lag for the paused partition, even though the partition may be falling further behind. This matters most when a pause is expected to last a while - for example, [Persistent Pausing](https://karafka.io/docs/Consumer-Groups-Persistent-Pausing.md) via the Filtering API, where a topic can stay paused for hours during a maintenance window. ### The Problem It Solves / How It Works When enabled, Karafka Pro periodically refreshes the watermark offsets and lags of long-paused partitions through the running consumer connection (a single batched `ListOffsets` query) and overlays the refreshed values onto the emitted statistics, so long-paused partitions report an accurate, moving lag. ### The Problem It Solves / Configuration The feature is disabled by default and controlled by two internal settings:
| Setting | Default | Description |
|---|---|---|
config.internal.statistics.consumer_groups.lag_compensation.interval |
0 |
How often, in milliseconds, to refresh the watermarks and lags of long-paused partitions at most. 0 disables the feature entirely. |
config.internal.statistics.consumer_groups.lag_compensation.pause_age |
30_000 |
How long, in milliseconds, a partition needs to stay continuously paused before it qualifies for compensation. Short pause and resume cycles reset the clock and never qualify. The minimum accepted value is 5_000, because statistics of partitions paused for a shorter time are fresh enough that compensating them is pointless. |