Skip to main content

CloudWatch

The CloudWatch check monitors the status of CloudWatch alarms in AWS. It can filter alarms by various criteria and supports transforming alarm data for custom health checks.

cloudwatch.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: cloudwatch
spec:
schedule: "@every 5m"
cloudwatch:
- name: cloudwatch test
region: "eu-west-1"
transform:
expr: |
results.MetricAlarms.filter(i, i.StateValue != 'OK' ).map(i,
{
'name': i.MetricName,
'icon': 'aws-cloudwatch-alarm',
'duration': time.Since(timestamp(i.StateTransitionedTimestamp)).getMilliseconds(),
'labels': fromAWSMap(i.Dimensions).
merge({'arn': i.AlarmArn}),
'message': "%s (%s) %s".format([i.AlarmDescription, i.AlarmArn, fromAWSMap(i.Dimensions)]),
}
).toJSON()
FieldDescriptionScheme
name*

Name of the check, must be unique within the canary

string

accessKey

Access Key ID

EnvVar

actionPrefix

Filter alarms that use a specific action prefix. For example, specify the ARN of an SNS topic to find all alarms that send notifications to that topic

*string

alarmPrefix

Filter alarms whose names start with this prefix

*string

alarms

List of specific alarm names to check

[]string

endpoint

Custom AWS Endpoint to use

string

region

The AWS region

string

secretKey

Secret Access Key

EnvVar

skipTLSVerify

Skip TLS verify when connecting to AWS

boolean

state

Filter alarms by state value (e.g., 'OK', 'ALARM', 'INSUFFICIENT_DATA')

string

description

Description for the check

string

display

Expression to change the formatting of the display

Expression

icon

Icon for overwriting default icon on the dashboard

Icon

labels

Labels for check

[map[string]string]

markFailOnEmpty

If a transformation or datasource returns empty results, the check should fail

boolean

metrics

Metrics to export from

[]Metrics

test

Evaluate whether a check is healthy

Expression

transform

Transform data from a check into multiple individual checks

Expression