如何将CloudWatch Lambda Insights添加到无服务器配置? [英] How to add CloudWatch Lambda Insights to serverless config?
问题描述
如何将CloudWatch Lambda Insights添加到无服务器配置?我不想手动执行此操作,因此我希望这是一个选择.
How to add CloudWatch Lambda Insights to serverless config? I don't want to do this manually, so I expect this to be an option.
我添加了这样的跟踪:
tracing:
lambda: true
但这只会启用AWS X-ray,而不会启用其他选项.
But this only enables AWS X-ray and not the other option.
推荐答案
我发现它不是设置,而是lambda中的一层.我设法用这段代码创建了它:
I found out that it isn't a setting but a layer in the lambda. I managed to create it with this piece of code:
provider:
name: aws
iamManagedPolicies:
- "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy"
functions:
functionName:
layers:
- arn:aws:lambda:<REGION>:580247275435:layer:LambdaInsightsExtension:<VERSION>
可以在以下位置找到最新版本的lambda见解层: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html
The latest version of the lambda insights layer can be found at: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html
这篇关于如何将CloudWatch Lambda Insights添加到无服务器配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!