Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Interpolate for less variable consumer lag in time estimates in Kafka Lag Exporter #5

Closed
seglo opened this issue Mar 11, 2019 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@seglo
Copy link
Owner

seglo commented Mar 11, 2019

Today Kafka Lag Exporter simply polls on a small interval and extrapolates lag based on two measurements from the past two intervals. This works reasonably well with a steady consumption pattern, but if consuming “flattens out” during one of those intervals than it can lead to very inflated lag in time estimates.

A solution is to interpolate based on a sliding window of measurements of the latest offset measurement. We capture latest offsets for a partition every interval, then to calculate lag in time we lookup the interval our last read offset is in. We interpolate to find the timestamp for what the offset was between that measured interval, then use it to determine how far behind the current consumer is.

@seglo seglo added the enhancement New feature or request label Apr 17, 2019
@seglo seglo added this to the 0.4.0 milestone Apr 17, 2019
@seglo seglo added the in progress PR for issue is in progress label Apr 17, 2019
@seglo seglo closed this as completed Apr 23, 2019
@seglo seglo removed the in progress PR for issue is in progress label Apr 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant