serverless-plugin-aws-alerts icon indicating copy to clipboard operation
serverless-plugin-aws-alerts copied to clipboard

Lambda Insight Memory Utilization metrics

Open ADailler opened this issue 3 years ago • 3 comments

This is a Bug Report

Description

For bug reports:

  • What went wrong?

    • Cannot use Lambdas Insight Metrics
  • What did you expect should have happened?

    • Use Lambda Insight memory_utilization metric
  • What was the config you used?

custom:
  lambdaInsights:
    defaultLambdaInsights: true #enables Lambda Insights for all functions
  alerts:
    stages:
      - prod
    topics:
      alarm: ${self:service}-${self:provider.stage}-alerts-alarm
      notifications:
        - protocol: email
          endpoint: ${file(./config.${self:provider.stage}.yml):EMAIL_ENDPOINT}
    definitions:
      memoryUsage:
        actionsEnabled: false
        description: 'Memory usage is too high'
        namespace: 'LambdaInsights'
        metric: memory_utilization # also try memoryUtilization
        threshold: 90
        statistic: Maximum
        period: 300
        evaluationPeriods: 1
        datapointsToAlarm: 1
        comparisonOperator: GreaterThanThreshold
    alarms:
      - functionErrors
      - memoryUsage
  • What stacktrace or error message from your provider did you see?
    • I can't see any error but the alarm is not connected to cloudwatch metric

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
  • If there is additional config how would it look

Similar or dependent issues:

  • no

Additional Data

  • Serverless Framework Version:
    • Framework Core: 2.43.1
    • Plugin: 5.1.4
    • SDK: 4.2.2
    • Components: 3.10.1
  • Stack Trace:
  • Provider Error messages:

ADailler avatar Sep 23 '21 12:09 ADailler

It appears that for the LambdaInsights namespace, the dimension name for the function should be function_name and not FunctionName in the generated CloudFormation template:

"Dimensions": [
  {
    "Name": "FunctionName",
    "Value": {
      "Ref": "NameOfLambdaLambdaFunction"
    }
  }
],

should be:

"Dimensions": [
  {
    "Name": "function_name",
    "Value": {
      "Ref": "NameOfLambdaLambdaFunction"
    }
  }
],

evvo avatar Mar 04 '22 20:03 evvo

Any movement on this? I am attempting use this metric, and it is not firing.

abduncan avatar Jun 07 '22 19:06 abduncan

We are facing the same problem any news on this?

dkefal avatar Jun 14 '23 10:06 dkefal