Components
Components updates emit the following events when its health changes
component.healthycomponent.unhealthycomponent.warningcomponent.unknown
unhelthy-component-notification.yamlapiVersion: 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: alerts@acme.com

Default Templates
The default notification template used is:
Title
{{ if ne channel "slack"}}Component {{.component.name}} is {{.component.health}}{{end}}
Template
{{if eq channel "slack"}}
{
	"blocks": [
		{{slackSectionTextMD (printf `%s *%s* is _%s_` (slackHealthEmoji .component.health) .component.name .component.health)}},
    {"type": "divider"},
    {{if .component.description}}{{slackSectionTextPlain .component.description}},{{end}}
		{
			"type": "section",
			"fields": [
        {{slackSectionTextFieldMD (printf `*Type*: %s` .component.type) }}
        {{if .component.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .component.status) }}{{end}}
				{{if ne .agent.name "local"}}
					,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
				{{end}}
			]
		},
		{{if .component.labels}}{{slackSectionLabels .component}},{{end}}
		{{if .groupedResources}}{{slackSectionTextMD (printf `*Also Failing:* %s` (join .groupedResources "\n"))}},{{end}}
		{{slackURLAction "View Component" .permalink "🔕 Silence" .silenceURL}}
	]
}
{{else}}
{{labelsFormat .component.labels}}
[Reference]({{.permalink}})
{{end}}
Template Variables
The notification title and body can be changed using the variables below:
| Field | Description | Scheme | 
|---|---|---|
agent | Details of the agent that created the Component.  | |
component | Link to the Component in mission control  | |
permalink | Link to the Component in mission control  | string  | 
Component
| Field | Description | Scheme | 
|---|---|---|
cost_per_minute | The cost per minute of the component  | 
  | 
cost_total_1d | The cost total 1d of the component  | 
  | 
cost_total_30d | The cost total 30d of the component  | 
  | 
cost_total_7d | The cost total 7d of the component  | 
  | 
created_at | Created timestamp  | 
  | 
created_by | Id of the person that created this component  | 
  | 
deleted_at | Deleted timestamp  | 
  | 
description | The description of the component  | string  | 
external_id | The external id of the component  | string  | 
hidden | Whether the component is hidden  | bool  | 
id | The id of the component  | 
  | 
labels | The labels of the component  | 
  | 
name | The name of the component  | string  | 
namespace | The namespace of the component  | string  | 
parent_id | The id of the parent component  | 
  | 
properties | The properties of the component  | 
  | 
silenced | Whether the component is silenced  | bool  | 
status | The status of the component  | string  | 
status_reason | The status reason of the component  | string  | 
summary | The summary of the component  | 
  | 
text | The text of the component  | string  | 
topology_type | The type of the topology  | string  | 
type | The type of the component  | string  | 
updated_at | Updated timestamp  | 
  | 
Agent
| Field | Description | Scheme | 
|---|---|---|
description | Short description of the agent  | string  | 
id | The id of the agent  | 
  | 
name | The name of the agent  | string  |