-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement regex exclusions for alerts
Signed-off-by: Stefan Prodan <[email protected]>
- Loading branch information
1 parent
ac36348
commit 5c9e95c
Showing
6 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ Spec: | |
|
||
```go | ||
type AlertSpec struct { | ||
// Send events using this provider | ||
// Send events using this provider. | ||
// +required | ||
ProviderRef meta.LocalObjectReference `json:"providerRef"` | ||
|
||
|
@@ -17,10 +17,14 @@ type AlertSpec struct { | |
// +optional | ||
EventSeverity string `json:"eventSeverity,omitempty"` | ||
|
||
// Filter events based on the involved objects | ||
// Filter events based on the involved objects. | ||
// +required | ||
EventSources []CrossNamespaceObjectReference `json:"eventSources"` | ||
|
||
// A list of Golang regular expressions to be used for excluding messages. | ||
// +optional | ||
ExclusionList []string `json:"exclusionList,omitempty"` | ||
|
||
// Short description of the impact and affected cluster. | ||
// +optional | ||
Summary string `json:"summary,omitempty"` | ||
|
@@ -115,3 +119,29 @@ spec: | |
- kind: HelmRelease | ||
name: nginx-ingress | ||
``` | ||
|
||
Skip alerting if the message matches a [Go regex](https://golang.org/pkg/regexp/syntax) | ||
from the exclusion list: | ||
|
||
```yaml | ||
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://[email protected]/v3/...', error: SSH could not read data: Error waiting on socket | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters