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.yamlapiVersion: 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()
Field | Description | Scheme |
---|---|---|
name* | Name of the check, must be unique within the canary |
|
accessKey | Access Key ID | |
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 |
|
endpoint | Custom AWS Endpoint to use |
|
region | The AWS region |
|
secretKey | Secret Access Key | |
skipTLSVerify | Skip TLS verify when connecting to AWS |
|
state | Filter alarms by state value (e.g., 'OK', 'ALARM', 'INSUFFICIENT_DATA') |
|
description | Description for the check |
|
display | Expression to change the formatting of the display | |
icon | Icon for overwriting default icon on the dashboard | |
labels | Labels for check |
|
markFailOnEmpty | If a transformation or datasource returns empty results, the check should fail |
|
metrics | Metrics to export from | |
test | Evaluate whether a check is healthy | |
transform | Transform data from a check into multiple individual checks |