-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: notification overview * feat: template vars * chore: kubernetes deployment health notification example * docs: slack template for components, config & check events * docs: add all notification template vars in reference * docs: complete all template vars for notification * chore: lint workflow change * chore: refactor config notification events page * chore: add slack notification screenshots * docs: notification rate limiting * docs: slack template functions * docs: use gomplate style for notification template functions * docs: repeat interval
- Loading branch information
1 parent
817c8dc
commit 1fddf7f
Showing
26 changed files
with
1,372 additions
and
386 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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Concepts | ||
sidebar_position: 2 | ||
--- | ||
|
||
import DocCardList from '@theme/DocCardList'; | ||
|
||
<DocCardList /> |
40 changes: 40 additions & 0 deletions
40
mission-control/docs/notifications/concepts/rate-limiting.mdx
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Rate Limiting | ||
--- | ||
|
||
To prevent overwhelming users with excessive notifications, Mission Control implements a rate limiting mechanism. | ||
|
||
We use a sliding window rate limiter that restricts the total number of notifications sent within a specified time period. | ||
Check warning on line 7 in mission-control/docs/notifications/concepts/rate-limiting.mdx GitHub Actions / vale[vale] mission-control/docs/notifications/concepts/rate-limiting.mdx#L7
Raw output
|
||
|
||
:::info | ||
The rate limit is applied individually to each notification. | ||
::: | ||
|
||
:::caution Rate Limited Notifications | ||
When a notification exceeds the rate limit, it is dropped and not delivered to the user. | ||
::: | ||
|
||
## Default Configuration | ||
|
||
The following table outlines the default rate limiting parameters: | ||
|
||
| Property | Value | | ||
|----------------------------------|----------| | ||
| Maximum number of notifications allowed per window | 50 | | ||
| Time period for the sliding window | 4 hours | | ||
Check warning on line 24 in mission-control/docs/notifications/concepts/rate-limiting.mdx GitHub Actions / vale[vale] mission-control/docs/notifications/concepts/rate-limiting.mdx#L24
Raw output
|
||
|
||
## Customizing Rate Limiting Parameters | ||
|
||
You can override the default settings by adjusting the following properties: | ||
|
||
- `notifications.max.count`: Sets the maximum number of notifications allowed within the window | ||
- `notifications.max.window`: Defines the duration of the sliding window (in hours) | ||
|
||
### Example Configuration | ||
|
||
To allow a maximum of 100 notifications in a 6 hour window: | ||
|
||
``` | ||
notifications.max.count=100 | ||
notifications.max.window=6h | ||
``` |
61 changes: 61 additions & 0 deletions
61
mission-control/docs/notifications/concepts/repeat-interval.mdx
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: Repeat Interval | ||
--- | ||
|
||
The repeat interval determines the duration between subsequent notifications after an initial successful delivery. | ||
|
||
```yaml title="deployment-failed.yaml" | ||
apiVersion: mission-control.flanksource.com/v1 | ||
kind: Notification | ||
metadata: | ||
name: config-updates | ||
namespace: default | ||
spec: | ||
events: | ||
- config.healthy | ||
- config.unhealthy | ||
- config.warning | ||
- config.unknown | ||
filter: config.type == "Kubernetes::Deployment" | ||
to: | ||
email: [email protected] | ||
repeatInterval: 2h | ||
``` | ||
The above notification sends at max 1 email notification in a moving 2 hour window. | ||
## Repeat Group | ||
By default, the repeat interval applies to any notification sent for the given notification. | ||
In the example above, if a notification is sent for a `config.healthy` event and then a new notification is to be sent | ||
for a `config.unhealthy` event, then the notification is dropped due to the repeat interval. | ||
|
||
With grouping, you can apply the repeat interval per source event & per resource ID. | ||
|
||
- `source_event` | ||
- `resource_id` | ||
|
||
```yaml title="deployment-updates.yaml" | ||
apiVersion: mission-control.flanksource.com/v1 | ||
kind: Notification | ||
metadata: | ||
name: config-updates | ||
namespace: default | ||
spec: | ||
events: | ||
- config.healthy | ||
- config.unhealthy | ||
- config.warning | ||
- config.unknown | ||
filter: config.type == "Kubernetes::Deployment" | ||
to: | ||
email: [email protected] | ||
repeatInterval: 2h | ||
// highlight-start | ||
repeatGroup: | ||
- source_event | ||
// highlight-end | ||
``` | ||
|
||
With this change, you'll now receive at max 4 notifications for each source event. | ||
Check warning on line 61 in mission-control/docs/notifications/concepts/repeat-interval.mdx GitHub Actions / vale[vale] mission-control/docs/notifications/concepts/repeat-interval.mdx#L61
Raw output
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.