Nil
Nil

Reputation: 348

Lambda CloudWatch Metric results are empty

I want to monitor my lambda function. I am able to see CloudWatch logs from Logs menu but I want to see monitoring results from Lambda console. When I click on the monitoring tab all the graphs are empty and it says that "No data available". What should I do to be able to see CloudWatch metric results?

enter image description here

Upvotes: 14

Views: 6630

Answers (5)

M3RS
M3RS

Reputation: 7510

Had this problem even though a specific version of the function was already selected (make sure you are NOT looking at the "unqualified" version of the function).

Had to click the below link to finally see the monitoring data.

enter image description here

This was probably needed because the function is in a different region than where invocations happened.

Upvotes: 1

SanD
SanD

Reputation: 543

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

  1. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html
  2. https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md
  3. https://github.com/awslabs/serverless-application-model/blob/master/docs/safe_lambda_deployments.rst#instant-traffic-shifting-using-lambda-aliases

Upvotes: 1

BrunoLM
BrunoLM

Reputation: 100322

If your Lambda function is associated with CloudFront go to CloudFront and select monitoring on the left menu

cloudfront lambda metrics

Direct link: https://console.aws.amazon.com/cloudfront/v2/home?#/monitoring

Then select the function and click "View function metrics"

function metrics

Upvotes: 4

Rune Skou Larsen
Rune Skou Larsen

Reputation: 186

Workaround:

  1. Go to Lambda page
  2. Press "Qualifiers" button to open menu.
  3. Instead Unqualified, select the specific alias you want to look at.
  4. 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

Upvotes: 17

Nil
Nil

Reputation: 348

I have managed to create a custom dashboard in CloudWatch dashboards menu. I have selected exactly same lambda metrics: invocations, errors, throttles and duration. I have also added different versions of duration (max, min and average) to make it look like the Lambda monitoring menu. I can see the filled graphs now. This is not the proper solution for the above problem but I get what I need.

enter image description here

Upvotes: 0

Related Questions