Skip to content

Commit

Permalink
docs: repeat interval
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 3, 2024
1 parent c3fe92f commit 3112bb4
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
61 changes: 61 additions & 0 deletions mission-control/docs/notifications/concepts/repeat-interval.mdx
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

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/notifications/concepts/repeat-interval.mdx#L61

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'you'll'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'you'll'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "mission-control/docs/notifications/concepts/repeat-interval.mdx", "range": {"start": {"line": 61, "column": 19}}}, "severity": "WARNING"}
12 changes: 11 additions & 1 deletion mission-control/docs/reference/notifications/_notification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
description: "Properties are channel dependent special directives to modify the notification message. Example: for email, `[email protected]` modifies the sender of the email. [Read more](https://containrrr.dev/shoutrrr/v0.8/)",

Check warning on line 35 in mission-control/docs/reference/notifications/_notification.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/_notification.mdx#L35

[alex.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.
Raw output
{"message": "[alex.Ablist] When referring to a person, consider using 'has a disability', 'person with a disability', or 'people with disabilities' instead of 'special'.", "location": {"path": "mission-control/docs/reference/notifications/_notification.mdx", "range": {"start": {"line": 35, "column": 52}}}, "severity": "WARNING"}
scheme: "`map[string]string`"
},
{
field: "repeatInterval",

Check failure on line 39 in mission-control/docs/reference/notifications/_notification.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/_notification.mdx#L39

[Flanksource.Spelling] Is 'repeatInterval' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'repeatInterval' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/_notification.mdx", "range": {"start": {"line": 39, "column": 13}}}, "severity": "ERROR"}
description: "The waiting time to resend a notification after it has been succefully sent.",

Check failure on line 40 in mission-control/docs/reference/notifications/_notification.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/_notification.mdx#L40

[Flanksource.Spelling] Is 'succefully' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'succefully' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/_notification.mdx", "range": {"start": {"line": 40, "column": 79}}}, "severity": "ERROR"}
scheme: "duration"
},
{
field: "repeatGroup",

Check failure on line 44 in mission-control/docs/reference/notifications/_notification.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/_notification.mdx#L44

[Flanksource.Spelling] Is 'repeatGroup' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'repeatGroup' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/_notification.mdx", "range": {"start": {"line": 44, "column": 13}}}, "severity": "ERROR"}
description: "RepeatGroup allows notifications to be grouped by certain set of keys and only send one per group within the specified repeat interval. Valid group keys: `resource_id` & `source_event`.",
scheme: "`[]string`"
},
{
field: "title",
description: "Channel dependent e.g. subject for email",
Expand All @@ -57,7 +67,7 @@
},
{
field: "filter",
description: "Filter narrows down the event trigger. Example: `check.type == 'http'` filter on `check.failed` event will only send notification for failing http checks.",
description: "Filter narrows down the event trigger.\n\nExample: `check.type == 'http'` filter on `check.failed` event will only send notification for failing http checks.",

Check warning on line 70 in mission-control/docs/reference/notifications/_notification.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/_notification.mdx#L70

[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.
Raw output
{"message": "[Flanksource.FutureTense] Use present tense verbs, not future tense verbs like 'will'. Say '(event) happens' instead of '(event) will happen'.", "location": {"path": "mission-control/docs/reference/notifications/_notification.mdx", "range": {"start": {"line": 70, "column": 124}}}, "severity": "WARNING"}
scheme: "CEL",
templateEnv: [

Check failure on line 72 in mission-control/docs/reference/notifications/_notification.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] mission-control/docs/reference/notifications/_notification.mdx#L72

[Flanksource.Spelling] Is 'templateEnv' spelled correctly? Is it missing code formatting?
Raw output
{"message": "[Flanksource.Spelling] Is 'templateEnv' spelled correctly? Is it missing code formatting?", "location": {"path": "mission-control/docs/reference/notifications/_notification.mdx", "range": {"start": {"line": 72, "column": 5}}}, "severity": "ERROR"}
{"name": "CheckEvents", "url": "/reference/notifications/template_vars#check-health-env"},
Expand Down

0 comments on commit 3112bb4

Please sign in to comment.