Skip to main content

Components

Components updates emit the following events when its health changes

  • component.healthy
  • component.unhealthy
  • component.warning
  • component.unknown
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: 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:

FieldDescriptionScheme
agent

Details of the agent that created the Component.

Agent

component

Link to the Component in mission control

Component

permalink

Link to the Component in mission control

string

Component

FieldDescriptionScheme
cost_per_minute

The cost per minute of the component

float64

cost_total_1d

The cost total 1d of the component

float64

cost_total_30d

The cost total 30d of the component

float64

cost_total_7d

The cost total 7d of the component

float64

created_at

Created timestamp

time.Time

created_by

Id of the person that created this component

uuid

deleted_at

Deleted timestamp

time.Time

description

The description of the component

string

external_id

The external id of the component

string

hidden

Whether the component is hidden

boolean

id

The id of the component

uuid

labels

The labels of the component

map[string]string

name

The name of the component

string

namespace

The namespace of the component

string

parent_id

The id of the parent component

uuid

properties

The properties of the component

map[string]string

silenced

Whether the component is silenced

boolean

status

The status of the component

string

status_reason

The status reason of the component

string

summary

The summary of the component

map[string]string

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

time.Time

Agent

FieldDescriptionScheme
description

Short description of the agent

string

id

The id of the agent

uuid

name

The name of the agent

string