1 Answers
0
I would recommend checking the Lambda metrics for the same time frame and check if the number of invocations changed, or if the duration changed. If you do not see any difference compared to other times, I recommend to create a support case.
Relevant questions
How to set the starting position for a Kinesis Delivery Stream
asked 25 days agoKinesis data stream iterator age spikes
asked 20 days agoLoad test kinesis data stream consumer
asked 5 months agoKinesis data stream - data transfer charges for on-premises consumer/producer
Accepted Answerasked 4 years agoJoin Streaming Data in Amazon Kinesis Firehose with Data in S3 via Athena using a Data transformation Lambda function
Accepted Answerasked 2 years agoAWS Kinesis Video stream
asked 10 days agoKinesis Transformation Buffering from Data Stream
Accepted Answerasked 3 months agoKinesis fan-out
Accepted AnswerWriting data to Kinesis stream from PySpark
Accepted AnswerMultiple Kinesis Data Analytics apps to use the same Kinesis firehose delivery stream as source
Accepted Answerasked 2 years ago
The spikes in iterator age are almost always when there are no lambda invocations, and it seems to happen more often when there is fewer data on the stream, but that could just be a coincidence. I have even seen this error happen multiple times when there was no data on the stream for days.
We are not on an AWS support plan, so we cannot create a support case. I guess we'll just have to keep going to figure out what is going on here.
This is really strange. The Iterator Age represents how far behind you are processing the events in the stream. Could it be that you have more than once consumer? If that is the case, and the second consumer doesn't reads messages constantly, when it will read messages, the iterator age will be big.
What metric are you looking at? GetRecords.IteratorAgeMilliseconds or the Lambda IteratorAge. If you are using the first one, I would expect that you have another consumer. If the second one, I have no clue.
There are 2 consumers. An AWS firehose delivery stream that converts records from JSON to parquet using standard configuration, so no lambda. And a lambda that processes the data on the stream. The entire application is configured using CDK, so besides these 2, there are no more consumers of this stream.
I am looking at the GetRecords.IteratorAgeMilliseconds metric of the kinesis stream. And Iterator age of the consumer lambda always hovers around 800 to 1800 milliseconds. What is a bit is another metric I found while investigating this, which is the "KinesisMillisBehindLatest" metric of the delivery stream. And this metric is almost identical to the "GetRecords.IteratorAgeMilliseconds" metric, but not always. Sometimes the kinesis stream has an iterator age of 11M and the "KinesisMillisBehindLatest" metric of the delivery stream is still at 0.
I did manage to find this GitHub issue that describes a similar issue. https://github.com/awslabs/amazon-kinesis-client/issues/185 but in my case I am not using the amazon-kinesis client. I am only using a lambda which is fed directly by the stream, and a delivery stream that converts records using Glue.
I do not know what is causing the issue, however, I think you are only interested in the iterator age of the Lambda function, so I would change my alarm to that metric.
That seems like it would probably be better in this case. I'll move the alarm to that metric. I'd rather have a proper solution for those stream spikes, but I'll settle for this. Thanks for your help.