Notifications
Notifications can be sent based on different type of events occuring including:
- Health check failing (
check.failed
) - Aggregated health of a topology failing (
component.unhealthy
) - A scraped config item health (
config.unhealthy
)
http-check.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: http-check
namespace: default
spec:
events:
- check.passed
filter: check.type == 'http'
to:
email: alerts@acme.com
Field | Description | Scheme | Required | Templatable |
---|---|---|---|---|
events | []Event | true | ||
to | Notification recipient | Recipient | true | |
title | Channel dependant e.g. subject for email | Go Template | true | |
template | Channel dependant e.g. email body for email | Go Template | true | |
filter | Filter out unwanted notifications | CEL |
Recipient
Field | Description | Schema |
---|---|---|
person | UUID or email of a person | |
team | Every member of the team with an email will receive a notification | UUID or name of team |
email | Send an email to an external user | email |
connection | Connection to external service | connection |
url | Custom notification URL | Channel |
properties | Only applicable if url is specified | map[string]string |
Only one recipient can be specified
Templating
Notification title and bodies can be templated using Go Templates
template-title.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
spec:
title: Check {{.check.name}} is {{.check.health}}
Filtering
Notifications can be filtered using CEL expressions. The filters have access to same variables that can be used in the templates.
filter-http.yaml---
# Only send a notification for HTTP checks
apiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: http-alerts
spec:
events:
- check.failed
filter: check.type == 'http'
to:
connection: connection://slack/flanksource
title: Check {{.check.name}} is {{.check.health}}