Conversation
|
@arunramani , could you please share some details as to how this metric would provide additional insight that is not already covered by metrics like Kafka lag, partition lag and/or message gap? |
There was a problem hiding this comment.
@arunramani , there are some problems with the current approach.
There is no guarantee that metrics would be emitted strictly every minute. This could lead to incorrect rate values (and thus an incorrect calculation of time lag downstream) since we are really just emitting the diff between the latestSequence at the last metric emission time at the latestSequence at the current time.
IIUC, we are trying to calculate the lag in terms of "how many minutes worth of records is the supervisor yet to process".
This value is fairly similar to the message gap but not quite the same.
The message gap is the "difference between the current timestamp of the system and the timestamp of the latest ingested record".
Whereas here, I think we want the "difference between the timestamp of the latest ingested record and the timestamp of the latest record in the stream".
If that is the case, I wonder if we even need the production rate.
Instead, do you think it would make more sense to simply calculate this timestamp difference and emit it?
Or are there challenges with that approach?
|
This pull request has been marked as stale due to 60 days of inactivity. |
@kfaraz I think having this approach would fail for late/early arriving data which happens very frequently with the streams that we are trying to deal. The best approach we have is to calculate the production rate and then make a best estimation of how many minutes are we lagging behind. Do you think this PR works in achieving that ? |
|
@adithyachakilam , you need not rely on the ingested timestamp for this. PS: You may put the new logic in |
|
Closing this PR in favor of #17735 |
Description
Add metric to track Kafka message production rate which can be useful for correlating with Kafka lag. For each collection period, the latest Kafka broker offset is compared with the previous minute to calculate the production rate.
One interesting use case is being able to use this metric to roughly calculate lag as time. This can be done by calculating the time
tsuch thatsum(time = now to t) of productionRate = lagi.e. how many minutes of production equals the current lag.Release note
Added a new streaming ingest metric
ingest/kafka/partitionProductionKey changed/added classes in this PR
SeekableStreamingSupervisorKafkaSupervisorThis PR has: