You have a stock market trading application.
It sends real-time data to AWS Kinesis which is then connected to a Lambda function to process and sort the information before it saves to a DynamoDB table.
Customers then consume this table via a dashboard.
As soon as the market opens, your customers complain that not all data is delivered to them.
Which Lambda CloudWatch metric should you look at first to resolve this problem?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: D.
Option A is incorrect as throttles will measure the number of Lambda function invocation attempts that were throttled when the invocation rates are more than concurrency limits.
In this case, this is not the first metric to look at, as failed invocations will often trigger retry attempts.
Option B is incorrect as this option is not a CloudWatch metric but a metric that can be observed via X-Ray.
Option C is incorrect as this metric is an aggregated value for all Lambda functions making it difficult to find data per function.
Option D is CORRECT as iterator age will determine the age of stream records processed by functions.
Amazon says, “Measures the age of the last record for each batch of records processed.
Age is the difference between the time Lambda received the batch and when the last record in the batch was written to the stream.
“This then leads to exceeding retention period for Kinesis.
This should be the first to look at as data streams are not processed as fast as the stream records are getting generated.
When the stock market opens, it's generally one of the busiest times of the day and could cause a spike in records.
Reference:
https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-metrics.html https://aws.amazon.com/premiumsupport/knowledge-center/lambda-iterator-age/The most appropriate Lambda CloudWatch metric to look at first in order to address the problem of customers not receiving all data from the stock market trading application is IteratorAge.
IteratorAge is a metric that tracks the age of the last record that was processed by a Lambda function. In other words, it measures the time between when a record was placed into the Kinesis stream and when it was processed by the Lambda function. This metric can help identify if there is a delay in processing records, which may be causing some records to be skipped or dropped.
If IteratorAge is high, it indicates that the Lambda function is taking longer to process records than the rate at which they are being added to the Kinesis stream. This could be due to a variety of factors such as insufficient processing power, poor network connectivity, or inefficient code. In this case, it is recommended to increase the processing power of the Lambda function or optimize the code to reduce processing time.
On the other hand, if IteratorAge is consistently low, it could indicate that the Kinesis stream is not receiving data at the expected rate or that there are other issues with data delivery. In this case, it is recommended to investigate the source of the data and ensure that it is being generated and sent to the Kinesis stream correctly.
While Throttles, Dwell time, and ConcurrentExecutions are also useful Lambda CloudWatch metrics to monitor, they are less relevant in this scenario. Throttles track the number of times a Lambda function is throttled due to reaching resource limits, but this is unlikely to be the cause of missing data. Dwell time measures the duration of the interval between a function being invoked and its execution being completed, which is not directly related to the delivery of data from Kinesis. ConcurrentExecutions track the number of function instances that are executing at a given time, which may be useful to identify if the function is overloaded, but it is not as directly related to the delivery of data from Kinesis as IteratorAge.