What you'll build
You'll create a CloudWatch dashboard named CloudPeek-Alarms with one Alarm status widget listing your production alarms. Alarms in ALARM are always listed first, so the one that needs you is the one you see. In CloudPeek it looks like this:
Before you start
- CloudWatch alarms to watch: metric alarms or composite alarms, in any region.
- Read-only access for CloudPeek. The
CloudPeekReadOnlypolicy from the spend guide already includescloudwatch:DescribeAlarms, which alarm widgets need. If you've set that up, you're ready. - A sign-in that can create CloudWatch dashboards, such as an administrator.
What it costs. The CloudWatch free tier includes three dashboards; beyond that, each dashboard is $3 a month. Alarm widgets refresh with DescribeAlarms rather than GetMetricData, so they don't add metric charges. See CloudWatch pricing for API request pricing.
1. Find your alarms
A dashboard lists alarms by their ARN, such as arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-api-5xx-errors. It names the alarm's region, account and name.
- In the console: open CloudWatch › Alarms › All alarms, choose an alarm and copy the ARN from its Details.
- With the AWS CLI: list the ARNs of every alarm whose name starts with
prod-:
aws cloudwatch describe-alarms \
--region us-east-1 \
--alarm-name-prefix prod- \
--query '[MetricAlarms[].AlarmArn, CompositeAlarms[].AlarmArn][]' \
--output json
2. Create the dashboard
Like any CloudWatch dashboard, it's defined by a short piece of JSON. Replace the three ARNs below with your own, as many as you like.
In the console
- Open the CloudWatch console and choose Create dashboard.
- Name it
CloudPeek-Alarmsand choose Create dashboard. If the Add widget window opens, close it. - Choose Actions › View/edit source, replace the source with the JSON below (with your ARNs), and choose Update.
- Choose Save.
{
"widgets": [
{
"type": "alarm",
"x": 0,
"y": 0,
"width": 12,
"height": 6,
"properties": {
"title": "Production alarms",
"sortBy": "stateUpdatedTimestamp",
"alarms": [
"arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-api-5xx-errors",
"arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-worker-queue-depth",
"arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-api-high-cpu"
]
}
}
]
}
With the AWS CLI
Download the JSON above, replace the ARNs, then run:
aws cloudwatch put-dashboard \
--region us-east-1 \
--dashboard-name CloudPeek-Alarms \
--dashboard-body file://production-alarms.json
Or, with jq, build the dashboard from every alarm whose name starts with prod-:
aws cloudwatch describe-alarms \
--region us-east-1 \
--alarm-name-prefix prod- \
--query '[MetricAlarms[].AlarmArn, CompositeAlarms[].AlarmArn][]' \
--output json |
jq '{widgets: [{type: "alarm", x: 0, y: 0, width: 12, height: 6,
properties: {title: "Production alarms", sortBy: "stateUpdatedTimestamp", alarms: .}}]}' \
> production-alarms.json
aws cloudwatch put-dashboard \
--region us-east-1 \
--dashboard-name CloudPeek-Alarms \
--dashboard-body file://production-alarms.json
How alarms are ordered
- Alarms in
ALARMalways come first in CloudPeek, then alarms without enough data, then any it can't find, then alarms that are OK. If you have more alarms than fit, the ones that need you are the ones shown. "sortBy": "stateUpdatedTimestamp"lists the most recent change first within each state, in CloudPeek and in the CloudWatch console. Without it, the console sorts alarms by name, and CloudPeek keeps the order they're listed in, still with alarms inALARMfirst.- A small widget shows how many are in alarm and the first three alarms. Medium shows four, each with how long ago it changed state, and large shows nine. Any more are counted as +N more.
- On the Lock Screen, the widget shows how many alarms are in alarm.
- Each ARN names its region, and CloudPeek looks each alarm up in its own region, so one widget can list alarms from several regions.
3. Sign in and pin your widget
- Open CloudPeek and add the account with your alarms on the Accounts tab, with an access key or IAM Identity Center. See signing in in the spend guide.
- On Home, open the CloudPeek-Alarms dashboard and tap Pin on Production alarms.
- Touch and hold an empty area of your Home Screen until the apps jiggle. Tap Edit, then Add Widget. Find CloudPeek, pick a size and tap Add Widget. Medium shows when each alarm last changed; small suits a quick count.
- New widgets show your first pinned widget. To choose another, touch and hold the widget and tap Edit Widget.
Troubleshooting
An alarm shows a question mark
Either it has too little data for CloudWatch to evaluate it yet, or CloudPeek couldn't find it. Check that the ARN's name, region and account match the alarm exactly: alarm names are case-sensitive. An alarm in another AWS account needs that account added in CloudPeek too.
CloudPeek says access is denied
The sign-in needs cloudwatch:DescribeAlarms. It's in the CloudPeekReadOnly policy and in the AWS managed CloudWatchReadOnlyAccess policy.
The order in the console is different
Without "sortBy": "stateUpdatedTimestamp", the CloudWatch console sorts alarms by name. Add it to the widget's properties to match CloudPeek.
Still stuck?
Email support@cloudpeek.app. Never send us your secret access key.