question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Metric Filter configuration producing unexpected results

See original GitHub issue

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:

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:11

github_iconTop GitHub Comments

2reactions
manthan1234567commented, Nov 6, 2019

It still seems to be problem. Have we done the fix?

2reactions
chinatticommented, Oct 1, 2018

I should do that - I’ve just been lazy (and I’ve never made a pull request before so I have to figure out how to do that 😃. Let me see if I can get that together in the next week or so…

Read more comments on GitHub >

github_iconTop Results From Across the Web

PutMetricFilter - Amazon CloudWatch Logs
With metric filters, you can configure rules to extract metric data from log events ... To prevent unexpected high charges, do not specify...
Read more >
Configure Metric Filtering - TechDocs - Broadcom Inc.
You can filter metrics while managing dashboards or configuring event rules for thresholds. Consider dashboard and threshold requirements before ...
Read more >
describe-metric-filters — AWS CLI 2.9.9 Command Reference
Filters results to include only those with the specified metric name. If you include this parameter in your request, you must also include...
Read more >
Filter and pattern syntax - Amazon CloudWatch Logs
You can create metric filters to match terms in your log events and convert log data into metrics. When a metric filter matches...
Read more >
CloudWatch log metric filter and alarm for AWS Organizations ...
This monitoring technique helps you to ensure that any unexpected changes performed within your AWS Organizations can be investigated and any unwanted ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found