-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add kinesis lag metric #9509
add kinesis lag metric #9509
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9509 +/- ##
============================================
+ Coverage 63.56% 64.55% +0.98%
- Complexity 23489 23571 +82
============================================
Files 3040 2932 -108
Lines 125895 119897 -5998
Branches 17410 16048 -1362
============================================
- Hits 80026 77394 -2632
+ Misses 38673 35519 -3154
+ Partials 7196 6984 -212
Continue to review full report at Codecov.
|
|
||
public Map<String, Long> getPartitionTimeLag(Map<String, String> currentOffsets) | ||
{ | ||
return partitionResources.entrySet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of partitions can be on the order of hundreds, would it make sense to avoid streams here for performance (I remember various issues in the past around stream perf)
protected abstract Map<PartitionIdType, Long> getPartitionRecordLag(); | ||
|
||
/** | ||
* Gets 'lag'of currently processed offset behind latest offset as a measure of the difference in time inserted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'lag'of -> 'lag' of
final String offsetToUse; | ||
if (offset == null || KinesisSupervisor.NOT_SET.equals(offset)) { | ||
// this should probably check if will start processing earliest or latest rather than assuming earliest | ||
// if latest we could skip this because latest will not be behing latest so lag is 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
behing -> behind
…s from kinesis supervisor report since always null, review stuffs
This reverts commit 142742f.
This reverts commit 142742f.
This reverts commit 142742f.
This reverts commit 05fbcab.
* Revert "Revert "add kinesis lag metric (apache#9509)" (#88)" This reverts commit 05fbcab. * refactor SeekableStreamSupervisor usage of RecordSupplier (apache#9819) * refactor SeekableStreamSupervisor usage of RecordSupplier to reduce contention between background threads and main thread, refactor KinesisRecordSupplier, refactor Kinesis lag metric collection and emitting * fix style and test * cleanup, refactor, javadocs, test * fixes * keep collecting current offsets and lag if unhealthy in background reporting thread * review stuffs * add comment
Fixes #6739.
Description
This PR adds an additional set of
SeekableStreamSupervisor
lag metrics, based on time in millis behind the latest offsets of the stream, allowing the Kinesis indexing service extension to have a lag metric.scheduleReporting
andemitLag
were pushed down fromKafkaSupervisor
intoSeekableStreamSupervisor
, and two additional abstract methods,getPartitionRecordLag
andgetPartitionTimeLag
which collect the two types of lag metrics per partition of the stream.Kafka's existing lag metrics are still collected in the same format for backwards compatibility.
and the new time metrics have a
/time
suffix.Currently
KafkaSupervisor
only emits the former set of metrics, andKinesisSupervisor
, after this PR, will emit only the latter. It seems possible forKafkaSupervisor
to emit both sets of metrics, but I will save that for a follow-up PR.Lag is also available on the supervisor status reports:
example kinesis supervisor status report:
example status report with suspended supervisor:
This PR has:
Key changed/added classes in this PR
SeekableStreamSupervisor
KafkaSupervisor
KinesisSupervisor