简体   繁体   English

Lambda 在哪里存储 Kinesis 批处理的重试次数?

[英]Where does Lambda store the retry count for a Kinesis batch?

I have several Lambdas that are triggred by Kinesis.我有几个由 Kinesis 触发的 Lambda。 The Lambdas are configured to handle a Kinesis Event struct - this event struct essentially contains a slice of Kinesis Records (so that one Lambda invocation can process thousands of records from a stream). Lambda 被配置为处理Kinesis 事件结构——该事件结构本质上包含一片 Kinesis 记录(以便一次 Lambda 调用可以处理流中的数千条记录)。

I've configured my Lambdas to enable BisectBatchOnFunctionError (documented here and here ) and MaximumRetryAttempts (to limit the number of retries if the Lambda errors out).我已将我的 Lambda 配置为启用BisectBatchOnFunctionError (记录在此处此处)和MaximumRetryAttempts (以在 Lambda 出错时限制重试次数)。 I would like to keep track of the number of retries for Kinesis batches - since an increase in retries could be the result of either an API error or a malformed Kinesis record.我想跟踪 Kinesis 批次的重试次数——因为重试次数的增加可能是 API 错误或 Kinesis 记录格式错误的结果。

Since I'm able to specify the MaximumRetryAttempts for a batch, then it stands to reason that the number of retries has to be tracked for each batch too (otherwise AWS wouldn't be able to tell whether the MaximumRetryAttempts had been met/exceeded) - but I'm unable to find where this count is tracked.由于我能够为批次指定MaximumRetryAttempts ,因此也必须跟踪每个批次的重试次数是理所当然的(否则 AWS 将无法判断是否达到/超过了MaximumRetryAttempts ) - 但我无法找到跟踪此计数的位置。

I've looked at both the aws-lambda-go repo, and the aws-sdk-go-v2 repo, and I can't find any reference to such a count.我查看了aws-lambda-go存储库和aws-sdk-go-v2存储库,但找不到任何关于此类计数的参考。 I've also looked through AWS docs, and can't find any reference to a retry count there either.我还查看了 AWS 文档,但也找不到任何对重试计数的引用。 Am I missing something here, or is this retry counter just some internal AWS metric?我在这里遗漏了什么,还是这个重试计数器只是一些内部 AWS 指标?

I would like to keep track of the number of retries for Kinesis batches - since an increase in retries could be the result of either an API error or a malformed Kinesis record.我想跟踪 Kinesis 批次的重试次数——因为重试次数的增加可能是 API 错误或 Kinesis 记录格式错误的结果。

You can track this just by using the Lambda's Errors metric, which will emit a 1 if a retry happens since retries happen on Lambda errors.您可以仅通过使用 Lambda 的Errors指标来跟踪这一点,如果发生重试,该指标将发出 1,因为重试发生在 Lambda 错误上。 If you see a spike in the Errors metric then there is a spike in retries is happening as well.如果您看到Errors指标出现峰值,那么重试也会出现峰值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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