Checking what consumes AWS lambda

£可爱£侵袭症+ 提交于 2019-12-01 09:40:41

问题


I have my AWS lambda, lets call it Lambda-X.

There are other lambdas, I don't know their names, that consumes my Lambda-X via API call.

How do I determine the names/ip/identifier of lambdas that sending requests to my Lambda-X?


回答1:


CloudWatch Metrics shows the number of invocations of each Lambda function. That will help you to determine which Lambda is being triggered the most frequently.

If that's insufficient, then each Lambda function obviously has a unique name. You could modify your initial Lambda functions to send that name as an additional 'source' event parameter to the invoked Lambda-X and then surface that as a custom metric.

Or you could scrape CloudWatch Logs, assuming that your lambdas emit an identifying log each time they invoke Lambda-X. Not a pretty solution, but might work for you.




回答2:


Take a look at using AWS X-Ray to generate traces for your lambda invocations. You'll get a bit more information than CloudWatch logs will provide, and you can trace things across services to better understand where latency might be coming from. Here's a blog post with an example: https://docs.aws.amazon.com/xray/latest/devguide/xray-services-lambda.html



来源:https://stackoverflow.com/questions/54220610/checking-what-consumes-aws-lambda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!