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:
It takes about five minutes if your alarms already exist.
Want every alarm, without a dashboard? In CloudPeek, tap Create Widget, choose Preset, then Alarms or Alarm summary under Logs and monitoring. Alarms lists every alarm in the account's default region, in the same order, and you can retitle it with Edit, to “Production alarms” for example; Alarm summary counts them, such as “2 failing, 20 OK”. To show only alarms whose names start with the same text, such as prod-, choose Names starting with… under Show in the preview (see Show only some). With more than one account added, choose All accounts in the preview to cover every account and the regions you tick, a line for each account, such as “prod: 2 failing · staging: all OK” (see Alarms in every account). Build the dashboard below to show the alarms you choose one by one, or alarms from several regions.
Before you start
- CloudWatch alarms to watch: metric alarms or composite alarms, in any region of one account.
- Access for CloudPeek. The
CloudPeekpolicy from Get started 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: it's billed per request, and the CloudWatch free tier covers an account's first million requests a month. See CloudWatch pricing.
1. Create the dashboard
A dashboard lists alarms by their ARN, such as arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-api-5xx-errors, which names the alarm's region, account and name.
- Open CloudWatch › Alarms › All alarms. For each alarm you want, open it and copy the ARN from its Details.
- Choose Dashboards › 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 dashboard JSON below with your ARNs in place of the examples, and choose Update.
- Choose Save.
You can also choose Add widget › Alarm status and tick the alarms instead of editing the source. Then add "sortBy": "stateUpdatedTimestamp" in the source so the most recent changes come first.
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
Put them in production-alarms.json (shown below) in place of the examples, 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 those alarms in one go:
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
Run it again whenever you add alarms.
If your alarms are in the same template, list them with ${Alarm.Arn} inside !Sub, and the dashboard always matches the alarms you deploy:
AlarmsDashboard:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardName: CloudPeek-Alarms
DashboardBody: !Sub |
{
"widgets": [
{
"type": "alarm", "x": 0, "y": 0, "width": 12, "height": 6,
"properties": {
"title": "Production alarms",
"sortBy": "stateUpdatedTimestamp",
"alarms": [
"${ApiErrorsAlarm.Arn}",
"${QueueDepthAlarm.Arn}"
]
}
}
]
}
Here ApiErrorsAlarm and QueueDepthAlarm are AWS::CloudWatch::Alarm resources in the same template. For alarms defined somewhere else, deploy cloudpeek-alarms.yaml with their ARNs:
Resources:
# sortBy puts the most recent change first within each state; CloudPeek always lists alarms in
# ALARM first. The ARNs are joined into a JSON array of strings.
Dashboard:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardName: !Ref DashboardName
DashboardBody: !Sub
- |
{
"widgets": [
{
"type": "alarm",
"x": 0,
"y": 0,
"width": 12,
"height": 6,
"properties": {
"title": "${WidgetTitle}",
"sortBy": "stateUpdatedTimestamp",
"alarms": [ "${Alarms}" ]
}
}
]
}
- Alarms: !Join ['", "', !Ref AlarmArns]
aws cloudformation deploy \
--stack-name CloudPeek-Alarms \
--template-file cloudpeek-alarms.yaml \
--parameter-overrides 'AlarmArns=arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-api-5xx-errors,arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-worker-queue-depth'
If your alarms are in the same configuration, list their arn attributes, and the dashboard always matches the alarms you apply:
resource "aws_cloudwatch_dashboard" "alarms" {
dashboard_name = "CloudPeek-Alarms"
dashboard_body = jsonencode({
widgets = [{
type = "alarm", x = 0, y = 0, width = 12, height = 6
properties = {
title = "Production alarms"
sortBy = "stateUpdatedTimestamp"
alarms = [
aws_cloudwatch_metric_alarm.api_5xx.arn,
aws_cloudwatch_metric_alarm.queue_depth.arn,
]
}
}]
})
}
Here api_5xx and queue_depth are aws_cloudwatch_metric_alarm resources in the same configuration. If you create alarms with for_each, list them all with [for alarm in aws_cloudwatch_metric_alarm.prod : alarm.arn]. For alarms defined somewhere else, apply cloudpeek-alarms.tf with their ARNs:
variable "alarm_arns" {
description = "The ARNs of the alarms to list. Each ARN names its own region, so one widget can list alarms from several regions."
type = list(string)
validation {
condition = length(var.alarm_arns) > 0
error_message = "List at least one alarm ARN."
}
}
# sortBy puts the most recent change first within each state; CloudPeek always lists alarms in
# ALARM first.
resource "aws_cloudwatch_dashboard" "alarms" {
dashboard_name = var.dashboard_name
dashboard_body = jsonencode({
widgets = [
{
type = "alarm"
x = 0
y = 0
width = 12
height = 6
properties = {
title = var.widget_title
sortBy = "stateUpdatedTimestamp"
alarms = var.alarm_arns
}
},
]
})
}
alarm_arns = [
"arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-api-5xx-errors",
"arn:aws:cloudwatch:us-east-1:123456789012:alarm:prod-worker-queue-depth",
]
terraform init
terraform apply
2. Add the account and pin the widget
- Open CloudPeek and add the account with your alarms on the Accounts tab, with an access key or IAM Identity Center. See Get started, step 2.
- On the Accounts tab, open the account, then the CloudPeek-Alarms dashboard, and tap Pin on Production alarms.
- Add CloudPeek to your Home Screen (see Home Screen and Lock Screen). It starts with Production alarms, the widget you pinned last. Medium shows when each alarm last changed; small suits a quick count.
- Tap the widget to see every alarm with CloudWatch's reason for its state and when that began, and to open any of them in the AWS console. On a medium or large widget, tap an alarm to go straight to it there.
Result: the widget lists your alarms, with any in alarm at the top. On the iPhone and iPad Lock Screen, it shows the headline, such as “1 in alarm” or “All OK”.
The dashboard, explained
Whichever tool you use, the dashboard ends up like this, with your own alarms' ARNs:
{
"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"
]
}
}
]
}
- An
alarmwidget lists alarms by ARN, as many as you like. "sortBy": "stateUpdatedTimestamp"lists the most recent change first within each state, in CloudPeek and in the CloudWatch console.- Each ARN names its region, and CloudPeek looks each alarm up in its own region, so one widget can list alarms from several regions.
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. - Without
sortBy, the console sorts alarms by name, and CloudPeek keeps the order they're listed in, still with alarms inALARMfirst. - A small widget shows its headline and the first three or four alarms. Medium and larger widgets show as many as fit, about a dozen on a large one, each with how long ago it changed state. Any more are counted as +N more.
- The headline, on small widgets and the Lock Screen, reads N in alarm in red, All OK in green when every alarm is OK, No data when none has enough data yet, or N unknown when some have no data or can't be found.
- Each alarm's symbol shows its state: see Alarm lists.
Get notified when an alarm fires
CloudPeek can send a notification when one of an alarm widget's alarms goes into ALARM, naming the alarm and giving CloudWatch's reason, such as “Threshold Crossed: 1 datapoint [12.0] was greater than the threshold (10.0).” It works for any alarm widget: one pinned from a dashboard, like Production alarms, or the Alarms and Alarm summary presets, including one across all your accounts, which notifies an alarm starting to fire in any of them (see Alarms in every account).
- On the Widgets tab, tap Production alarms to open its own screen.
- Turn on Notify When an Alarm Fires, under the list of alarms.
- The first time, your phone asks whether CloudPeek may send you notifications (on Android, from Android 13): tap Allow.
Result: the switch is on. When a refresh finds one of the widget's alarms in alarm that wasn't at the refresh before, you get a notification such as “prod-api-5xx-errors is in alarm”. Tap it to open the widget's screen, with every alarm's reason and a link to each in the AWS console.
Notifications come from the widget's refreshes: by Home Screen widgets showing it (and Lock Screen widgets, on iPhone and iPad), including an Overview that lists it, and in the app. Keep the widget on your Home Screen, as in step 2, or it's only refreshed while you have CloudPeek open.
Not a replacement for paging. Notifications come from the widget's refreshes, so they're only as quick as widgets refresh: on iPhone and iPad often tens of minutes apart, and less often in Low Power Mode or when you rarely look at the widget; on Android at most every 15 minutes, and less often while the phone saves battery (see When widgets refresh). Opening the app refreshes it too. Keep paging through Amazon SNS or your on-call tool for alarms that need someone within minutes.
- Each alarm is notified once each time it goes into alarm, however many refreshes or widgets find it. One already in alarm when you turn notifications on is notified the next time it fires. One going from OK to not enough data isn't firing, so it isn't notified.
- Up to three alarms that start firing at once get a notification each. More than that come as one notification naming them all, such as “4 alarms are in alarm”.
- An alarm with the same name as another the widget lists is named with its region, and across accounts with its AWS account ID when that's what tells them apart, such as “api-5xx (us-east-1, 222222222222) is in alarm”.
- Notifications are made on your phone or tablet from what the widget fetched. Nothing is sent to CloudPeek or a push service, and they need no AWS permission the widget doesn't already have.
- Removing the widget turns its notifications off, and Undo turns them back on.
- If notifications are off for CloudPeek in your phone's Settings, the widget's screen says “Notifications are off for CloudPeek. Allow them in Settings to be notified.” On iPhone and iPad, tap Open Settings, turn on Allow Notifications, then come back to CloudPeek. On Android, tap Open settings, which opens CloudPeek's notification settings, turn them on, then come back.
Troubleshooting
An alarm shows a dashed circle
CloudPeek couldn't find it. Check that the ARN's name, region and account match the alarm exactly: alarm names are case-sensitive. CloudPeek looks alarms up in the account you pinned the widget from, so an alarm in another AWS account can't be found; put it on a dashboard in that account and add that account to CloudPeek.
An alarm shows a question mark
It doesn't have enough data for CloudWatch to evaluate it yet, as in the console. It's listed after alarms in ALARM.
CloudPeek says access is denied
The sign-in needs cloudwatch:DescribeAlarms. It's in the CloudPeek policy and in the AWS managed CloudWatchReadOnlyAccess policy.
Notifications don't arrive
Check that Notify When an Alarm Fires is on for the widget, that its screen doesn't say notifications are off, and that the widget is on your Home Screen (or, on iPhone and iPad, your Lock Screen), whose refreshes send them. They come only as often as the widget refreshes, and an alarm that was already in alarm is notified the next time it fires. See Get notified when an alarm fires.
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.
Something else
See Troubleshooting, or email support@cloudpeek.app. Never send us your secret access key.