ACloudGuru/serverless-plugin-aws-alerts

Metric Filter configuration producing unexpected results

Open

#53 opened on Feb 1, 2018

View on GitHub
 (11 comments) (5 reactions) (0 assignees)JavaScript (150 forks)auto 404
bughelp wanted

Repository metrics

Stars
 (523 stars)
PR merge metrics
 (PR metrics pending)

Description

This is a Bug Report

Description

I am trying to configure a metric filter alarm with a given filter pattern for the function under my service,

custom:
  alerts:
    topics:
      alarm: 
        topic: arn:aws:sns:eu-west-1:704255512929:CloudWatch-ErrorLogs
    function:
      - name: AnAlarm
        metric: AnError
        treatMissingData: notBreaching
        threshold: 0
        statistic: Sum
        period: 60
        evaluationPeriods: 1
        comparisonOperator: GreaterThanThreshold
        pattern: '[ERROR]'

I was expecting this to create a single metric filter (ERROR) linked a single alarm that is then linked to an SNS Topic (CloudWatch-ErrorLogs), however what is actually happening is 2 metric filters are being created, one with a suffix ALERT and another with a suffix OK. Both of these are then linked to the same metric and the same alert.

From reviewing the code it appears there is code specific to create 2 metric filters, one for the Alert and one for the OK and I wondered why this was the case? Would it be possible to support a way of configuring it to exclude the OK metric filters?

Additional Data

  • Serverless Framework Version: 1.26.0:

Contributor guide