Skip to content

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Feb 8, 2021

This PR adds a option field called exclusionList to the Alert API.

Fix: #137

Example usage

Skip alerting if the message matches a golang regex from the exclusion list:

apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Alert
metadata:
  name: flux-system
  namespace: flux-system
spec:
  providerRef: 
    name: on-call-slack
  eventSeverity: error
  eventSources:
    - kind: GitRepository
      name: flux-system
  exclusionList:
    - "waiting.*socket"

The above definition will not send alerts for transient Git clone errors like:

unable to clone 'ssh://git@ssh.dev.azure.com/v3/...', error: SSH could not read data: Error waiting on socket

@stefanprodan stefanprodan added enhancement New feature or request area/alerting Alerting related issues and PRs labels Feb 8, 2021
@stefanprodan stefanprodan requested a review from hiddeco February 8, 2021 12:30
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan merged commit 8ccdc94 into main Feb 8, 2021
@stefanprodan stefanprodan deleted the alert-exclusionList branch February 8, 2021 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Alerting related issues and PRs enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude messages from alerting
2 participants