ACloudGuru / serverless-plugin-aws-alerts

A Serverless Framework plugin that creates CloudWatch alarms for functions.
MIT License
531 stars 149 forks source link

Unable to get Multiple topic definitions working #245

Open mayanagarwal opened 1 year ago

mayanagarwal commented 1 year ago

This is a Bug Report

Description

Unable to get Multiple topic definitions working when following the docs.

serverless.yml contents-

alerts:
  stages:
  - prod
  - dev
  topics:
    nonCritical:
      alarm:
        topic: ${sls:stage}-alerts-alarm
        notifications:
        - protocol: email
          endpoint: <EMAIL>
    critical:
      ok:
        topic: ${sls:stage}-critical-alerts-ok
        notifications:
        - protocol: https
          endpoint: <ENDPOINT>
      alarm:
        topic: ${sls:stage}-critical-alerts-alarm
        notifications:
        - protocol: https
          endpoint: <ENDPOINT>
  definitions:
    twentyRepeatedFunctionErrors:
      namespace: "AWS/Lambda"
      metric: Errors
      threshold: 20
      statistic: Sum
      period: 300
      evaluationPeriods: 1
      datapointsToAlarm: 1
      comparisonOperator: GreaterThanOrEqualToThreshold
      treatMissingData: missing
      okActions:
        - critical
      alarmActions:
        - critical
    threeRepeatedFunctionErrors:
      namespace: "AWS/Lambda"
      metric: Errors
      threshold: 3
      statistic: Sum
      period: 300
      evaluationPeriods: 1
      datapointsToAlarm: 1
      comparisonOperator: GreaterThanOrEqualToThreshold
      treatMissingData: missing
      alarmActions:
        - nonCritical
    increasedFunctionErrors:
      namespace: "AWS/Lambda"
      metric: Errors
      threshold: 0.5
      statistic: Average
      period: 1200
      evaluationPeriods: 1
      datapointsToAlarm: 1
      comparisonOperator: GreaterThanOrEqualToThreshold
      treatMissingData: breaching
      alarmActions:
        - nonCritical

Additional Data