Skip to main content

Configs

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
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: alerts@acme.com

Default Template

The default notification template for health events is:

Title

{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} is {{.config.health}}{{end}}

Template

{{if eq channel "slack"}}
{
"blocks": [
{{slackSectionTextMD (printf `%s *%s* is _%s_` (slackHealthEmoji .config.health) .config.name .config.health)}},
{"type": "divider"},
{{if .config.description}}{{slackSectionTextPlain .config.description}},{{end}}
{
"type": "section",
"fields": [
{{slackSectionTextFieldMD (printf `*Type*: %s` .config.type) }}
{{if .config.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .config.status) }}{{end}}
{{if ne .agent.name "local"}}
,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
{{end}}
]
},
{{if .config.labels}}{{slackSectionLabels .config}},{{end}}
{{slackURLAction "View Catalog" .permalink "🔕 Silence" .silenceURL}}
]
}

{{else}}
{{labelsFormat .config.labels}}

[Reference]({{.permalink}})
{{end}}

State events

  • config.created
  • config.updated
  • config.deleted
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: alerts@acme.com

Default Template

Title

{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} was {{.new_state}}{{end}}

Template

{{if eq channel "slack"}}
{
"blocks": [
{{slackSectionTextMD (printf `:information_source: *%s* was _%s_` .config.name .new_state)}},
{"type": "divider"},
{{if .config.description}}{{slackSectionTextPlain .config.description}},{{end}}
{
"type": "section",
"fields": [
{{slackSectionTextFieldMD (printf `*Type*: %s` .config.type) }}
{{if .config.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .config.status) }}{{end}}
{{if ne .agent.name "local"}}
,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
{{end}}
]
},
{{if .config.labels}}{{slackSectionLabels .config}},{{end}}
{{slackURLAction "View Catalog" .permalink "🔕 Silence" .silenceURL}}
]
}

{{else}}
{{labelsFormat .config.labels}}

[Reference]({{.permalink}})
{{end}}

Template Variables

FieldDescriptionScheme
agent

Details of the agent that created the config.

config

Corresponding config item.

new_state

The db state change that caused this event.

Only available on state events.

permalink

Link to the Catalog in mission control

string

Config Item

FieldDescriptionScheme
config

Configuration

string

config_class

Class of the config item

string

created_at

Creation timestamp

delete_reason

Reason for deletion

string

deleted_at

Deletion timestamp

description

Description

string

external_id

External IDs

health

Health

id

ID of the config item

labels

Labels

name

Name

string

properties

Properties

ready

Whether the config item is ready

boolean

scraper_id

ID of the scraper

string

source

Source

string

status

Status

string

tags

Tags

type

Type

string

updated_at

Update timestamp

Agent

FieldDescriptionScheme
description

Short description of the agent

string

id

The id of the agent

name

The name of the agent

string