Skip to main content

CloudWatch

Cloudwatch checks for all active alarms

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

Use to filter the results of the operation to only those alarms that use a certain alarm action. Fr example you could specify the ARN of an SNS topic to find all alarms that send notifications to that topic

alarmPrefix

Specify to receive information about all alarms that have names that start with this prefix.

alarms

Set field to retrieve information about alarm

connection

The connection url to use, mutually exclusive with accessKey and secretKey

Connection

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

Specify to retrieve state value of alarm

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