Skip to content

Commit

Permalink
docs: examples of silence filters
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Nov 18, 2024
1 parent dedc269 commit 8a41b3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mission-control/docs/notifications/concepts/silences.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,24 @@ on each notification.
A silence can optionally contain a filter. A filter is a cel-expression that results in a boolean value.
If a filter return true, the notification is silenced.

Example: `check.type == 'http'` filter silences only HTTP check related notifications.
#### Examples

| Filter | description |
|--------|-------------|
| `check.type == 'http'` | silences only HTTP check related notifications. |
| `regexp.Match("^check-[0-9]+", check.name)` | matches any check with the prefix `check-` |
| `config.name == "postgresql" && config.type == "Kubernetes::StatefulSet"` | silences notifications from a stateful set named "postgresql" |
| `config.type == "Kubernetes::Pod" && catalog.traverse(config.id, "Kubernetes::Namespace", "incoming").size > 0 && catalog.traverse(config.id, "Kubernetes::Namespace", "incoming")[0].tags.?env.orValue("") == "prod"` | matches kubernetes pod in a prod namespace |

#### Template variables

- [CheckEvents](/reference/notifications/template_vars/checks)
- [ConfigEvents](/reference/notifications/template_vars/config)
- [ComponentEvents](/reference/notifications/template_vars/components)

## Recursive mode
### Recursive mode

When a silence is recursively applied, it applies to its all children.
So silencing a namespace would silence all deployments, statefulsets, pods, etc in that namespace.


0 comments on commit 8a41b3e

Please sign in to comment.