Components
Components updates emit the following events when its health changes
component.healthy
component.unhealthy
component.warning
component.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}}
{{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 |
|
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 |
|
external_id | The external id of the component |
|
hidden | Whether the component is hidden |
|
id | The id of the component |
|
labels | The labels of the component |
|
name | The name of the component |
|
namespace | The namespace of the component |
|
parent_id | The id of the parent component |
|
properties | The properties of the component |
|
silenced | Whether the component is silenced |
|
status | The status of the component |
|
status_reason | The status reason of the component |
|
summary | The summary of the component |
|
text | The text of the component |
|
topology_type | The type of the topology |
|
type | The type of the component |
|
updated_at | Updated timestamp |
|
Agent
Field | Description | Scheme |
---|---|---|
description | Short description of the agent |
|
id | The id of the agent |
|
name | The name of the agent |
|