简体   繁体   中英

How to tell if a kinesis stream is not being processed

When processing an AWS Kinesis stream, how to tell if a consumer is no longer processing the stream? Is there a metric in Kinesis that I can use for alarming for example?

There is a metric for IteratorAgeMilliseconds however, this metric is only written when a stream is being processed. So in case a consumer is down and the stream is backing up with messages, we would know that this happened only when we resume processing.

You can use GetRecords.Bytes to determine whether the stream is being read.

If you have only one consumer, you could use metric math to compare it with PutRecords.Bytes and/or PutRecord.Bytes . With more than one consumer you'd need to divide the gets by the number of consumers, and if you have a variable number of consumers that isn't going to work.

You could also enable anomaly detection on the stream. I haven't done this, so can't tell you how well it works.

But the approach that I prefer (and have used successfully multiple times) is to have your consumer write a custom metric, such as the number of records that it's processed. Then you can set up an alarm on the consumer not reporting that metric.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM