AWS Lambda - 错误来源?
AWS Lambda 提供了一个名为“错误计数和成功率 (%)”的 CloudWatch/所有指标/仪表板。
可从 AWS Lambda/Dashboard/Error count and successrate (%)/View in Metrics 获取此控制面板的链接。提示单击右上角错误图中的汉堡包。
问题: 我正在寻找导致错误创建的 Lambda 错误来源(可能有 1 个或数百个函数)?
为什么: 我需要抛出错误的 Lambda 函数列表(对我来说,它们通常是超时),但我们想要跟踪的这些错误可能会随着时间的推移而改变。
我能做什么: 我可以为每个 Lambda 函数创建特定的 CloudWatch 规则。这效率不高,因为可能有 100 个 +++ 函数。我也可以使用 CDLI,但这仅限于最多 20 倍的 CloudWatch Logs,即:
aws 日志启动查询 --log-group-name /aws/lambda/lambdaFunction1020 --开始时间 1646185910 --结束时间 1646358710 --query-string '字段@timestamp,@message |筛选 @message 就像“任务超时”|排序 @timestamp desc |限制20'
AWS Lambda provides a CloudWatch/All Metrics/ Dashboard called "Error count and success rate (%)".
The link to this Dashboard is available from AWS Lambda/Dashboard/Error count and success rate (%)/View in metrics. Tip click the hamburger in the Error graph, top right.
Question:
I am looking for the source of the Lambdas' error/s (there could be 1 or hundreds of functions) that contribute to the creation of the Errors?
Why:
I need the list of Lambda functions that are throwing errors (for me they are typically timeouts), but these errors we want to track may change over time.
What I could do:
I could create a specific CloudWatch rule for each Lambda function. This is not efficient as there maybe 100's +++ of functions. I could also use the CDLI however this is limited to a maximum of 20x CloudWatch Logs ie:
aws logs start-query --log-group-name
/aws/lambda/lambdaFunction1020 --start-time 1646185910 --end-time
1646358710 --query-string 'fields @timestamp, @message | filter
@message like "Task timed out" | sort @timestamp desc | limit 20'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案就在: https://docs .aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-buildquery.html
转到:Cloudwatch/All Metrics/Query 并使用以下 SQL。据我所知,返回结果的数量没有限制。我发现的唯一问题是时间范围最多限制为三 (3) 小时。
对于许多 AWS 服务,“添加查询”下还有许多预构建的查询...
The answer is in: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-buildquery.html
Go to: Cloudwatch/All Metrics/Query and use the following SQL. From what I can see there are no LIMITS on the number of results returned. The only issue I have found is the time frame is limited to a maximum of three (3) hours.
There is also a number of pre-built queries under "Add query" for many AWS services...