Lambda CloudWatch Metric results are empty
If your Lambda function is associated with CloudFront go to CloudFront and select monitoring on the left menu
Direct link: https://console.aws.amazon.com/cloudfront/v2/home?#/monitoring
Then select the function and click "View function metrics"
Workaround:
- Go to Lambda page
- Press "Qualifiers" button to open menu.
- Instead Unqualified, select the specific alias you want to look at.
- Go to Monitoring tab
Now the graphs should be there.
Direct link: https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1#/functions/myLambdaFunctionName/aliases/myLambdaFunctionAlias?tab=monitoring
The accepted answer works. But here us why it works.
In the AWS lambda metrics console, by default it selects the "LATEST" alias in qualifiers. If your lambda is not versioned or doesn't have an alias set, this works without any issue.
However if your lambda is versioned and you set an alias to the latest version, you have to select this alias instead of the "LATEST" in the qualifier tab.
A simple example of how this can happen is if you are using AWS SAM.
If your lambda is created using SAM (AWS Serverless Application Model) [1][2] and use an autopublish alias[2], you get your metrics in the lambda console for that alias.
Resources
- https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html
- https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md
- https://github.com/awslabs/serverless-application-model/blob/master/docs/safe_lambda_deployments.rst#instant-traffic-shifting-using-lambda-aliases