-
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 f07512b
Showing
6 changed files
with
80 additions
and
0 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 |
---|---|---|
|
@@ -21,6 +21,10 @@ type AlertSpec struct { | |
// +required | ||
EventSources []CrossNamespaceObjectReference `json:"eventSources"` | ||
|
||
// A list of golang regex expressions to be used for excluding meesages | ||
// +optional | ||
ExclusionList []string `json:"exclusionList,omitempty"` | ||
|
||
// Short description of the impact and affected cluster. | ||
// +optional | ||
Summary string `json:"summary,omitempty"` | ||
|
@@ -115,3 +119,28 @@ spec: | |
- kind: HelmRelease | ||
name: nginx-ingress | ||
``` | ||
|
||
Skip alerting if the messages matches a golang regex 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