-
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: complete all template vars for notification
- Loading branch information
1 parent
cef5f01
commit 8c979d5
Showing
8 changed files
with
554 additions
and
409 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: Components | ||
description: Events that fire on topology/component changes | ||
--- | ||
|
||
import { ComponentHealthEnv, AgentEnv, ComponentEnv } from "../../reference/notifications/_env_vars.mdx" | ||
|
||
Components updates emit the following events when its health changes | ||
|
||
- `component.healthy` | ||
- `component.unhealthy` | ||
- `component.warning` | ||
- `component.unknown` | ||
|
||
```yaml title="unhelthy-component-notification.yaml" | ||
apiVersion: mission-control.flanksource.com/v1 | ||
kind: Notification | ||
metadata: | ||
name: web-api-component-alert | ||
namespace: default | ||
spec: | ||
events: | ||
- component.unhealthy | ||
filter: component.type == 'WebAPI' | ||
title: WebAPI {{.component.name}} failing | ||
body: | | ||
## Component Failed | ||
Status: {{.component.status}} | {{.component.status_reason}} | ||
Last updated: {{.component.updated_at}} | ||
to: | ||
email: [email protected] | ||
``` | ||
## Default Templates | ||
The default notification template used is: | ||
### Title | ||
``` | ||
{{ if ne channel "slack"}}Component {{.component.name}} is {{.component.health}}{{end}} | ||
``` | ||
|
||
### Template | ||
|
||
```txt file=../../../modules/mission-control/notification/templates/component.health | ||
``` | ||
|
||
## Template Variables | ||
|
||
The notification title and body can be changed using the variables below: | ||
<ComponentHealthEnv /> | ||
|
||
### Component | ||
|
||
<ComponentEnv /> | ||
|
||
### Agent | ||
<AgentEnv /> |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
title: Configs | ||
description: Events that fire on config changes and health | ||
--- | ||
|
||
import { | ||
ConfigDBStateEnv, CheckHealthEnv, ConfigHealthEnv, ComponentHealthEnv, | ||
AgentEnv, ConfigItemEnv, ComponentEnv, CanaryEnv, CheckEnv, CheckStatus, | ||
Uptime, Latency | ||
} from "../../reference/notifications/_env_vars.mdx" | ||
|
||
Configs emit events when their health changes or when they are created, modified, or removed. | ||
|
||
**Health events** | ||
|
||
- `config.healthy` | ||
- `config.unhealthy` | ||
- `config.warning` | ||
- `config.unknown` | ||
|
||
**State events** | ||
|
||
- `config.created` | ||
- `config.updated` | ||
- `config.deleted` _(Soft Delete)_ | ||
|
||
```yaml title="ec2-instance-updates.yaml" | ||
apiVersion: mission-control.flanksource.com/v1 | ||
kind: Notification | ||
metadata: | ||
name: ec2-instance-changes | ||
namespace: default | ||
spec: | ||
events: | ||
- config.created | ||
- config.updated | ||
- config.deleted | ||
filter: config.type == 'AWS::EC2::Instance' | ||
to: | ||
email: [email protected] | ||
``` | ||
```yaml title="ec2-health-notification.yaml" | ||
apiVersion: mission-control.flanksource.com/v1 | ||
kind: Notification | ||
metadata: | ||
name: ec2-instance-health-alerts | ||
namespace: default | ||
spec: | ||
events: | ||
- config.unhealthy | ||
- config.warning | ||
filter: config.type == 'AWS::EC2::Instance' | ||
to: | ||
email: [email protected] | ||
``` | ||
## Default Templates | ||
The default notification template for health events is: | ||
### Health notifications | ||
#### Title | ||
``` | ||
{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} is {{.config.health}}{{end}} | ||
``` | ||
|
||
#### Template | ||
|
||
```txt file=../../../modules/mission-control/notification/templates/config.health | ||
``` | ||
|
||
### State change notifications | ||
|
||
#### Title | ||
|
||
``` | ||
{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} was {{.new_state}}{{end}} | ||
``` | ||
|
||
#### Template | ||
|
||
```txt file=../../../modules/mission-control/notification/templates/config.db.update | ||
``` | ||
|
||
## Template Variables | ||
|
||
### Config State Env | ||
<ConfigDBStateEnv /> | ||
|
||
### Config Health Env | ||
<ConfigHealthEnv /> | ||
|
||
### Config Item | ||
<ConfigItemEnv /> | ||
|
||
### Agent | ||
<AgentEnv /> |
Oops, something went wrong.