AWS for DevOps — CloudWatch Dashboards

2 minute read

10.3 — CloudWatch Dashboards

Dashboards give you a single-pane view of your system’s health. Build them for your team, your on-call, and your stakeholders.

Creating a Dashboard

$ aws cloudwatch put-dashboard \
    --dashboard-name production-overview \
    --dashboard-body '{
        "widgets": [
            {
                "type": "metric",
                "x": 0, "y": 0, "width": 12, "height": 6,
                "properties": {
                    "title": "ECS CPU Utilization",
                    "metrics": [
                        ["AWS/ECS", "CPUUtilization", "ServiceName", "api", "ClusterName", "production"]
                    ],
                    "period": 300,
                    "stat": "Average",
                    "region": "ap-south-1"
                }
            },
            {
                "type": "metric",
                "x": 12, "y": 0, "width": 12, "height": 6,
                "properties": {
                    "title": "ALB 5XX Errors",
                    "metrics": [
                        ["AWS/ApplicationELB", "HTTPCode_Target_5XX_Count", "LoadBalancer", "app/my-alb/abc123"]
                    ],
                    "period": 60,
                    "stat": "Sum",
                    "region": "ap-south-1"
                }
            },
            {
                "type": "log",
                "x": 0, "y": 6, "width": 24, "height": 6,
                "properties": {
                    "title": "Recent Errors",
                    "query": "fields @timestamp, @message | filter @message like /ERROR/ | sort @timestamp desc | limit 20",
                    "region": "ap-south-1",
                    "stacked": false,
                    "view": "table"
                }
            }
        ]
    }'

Widget Types

Widget Purpose Example
Metric Line/bar chart of CloudWatch metrics CPU, memory, request count
Log Logs Insights query results Recent errors, slow queries
Alarm Status of alarms (OK/ALARM) System health overview
Text Markdown text Runbook links, team info
Number Single metric value (big number) Current error count

Dashboard Design for On-Call

A production dashboard should answer these questions at a glance:

  ┌─────────────────────────────────────────────────────┐
  │  PRODUCTION OVERVIEW                                 │
  ├─────────────────────┬───────────────────────────────┤
  │  Alarm Status       │  Request Rate                  │
  │  🟢 CPU             │  ████████████  1,200 req/s     │
  │  🟢 Memory          │                                │
  │  🔴 5XX Errors      │  Error Rate                    │
  │  🟢 Latency         │  ██  2.1% (target: <1%)       │
  ├─────────────────────┴───────────────────────────────┤
  │  Latency (p99)                                       │
  │  ▂▃▂▃▂▅▇█▅▃▂▃  ← spike at 10:15                   │
  ├─────────────────────────────────────────────────────┤
  │  ECS Tasks: 5 running / 5 desired                   │
  │  Lambda Errors: 3 in last hour                      │
  ├─────────────────────────────────────────────────────┤
  │  Recent Errors (Log Insights)                       │
  │  10:15:32  ERROR  Connection timeout to RDS         │
  │  10:15:33  ERROR  Connection timeout to RDS         │
  │  10:15:34  ERROR  Connection timeout to RDS         │
  └─────────────────────────────────────────────────────┘
Dashboard Audience Key Widgets
Production Overview On-call engineer Alarm status, error rate, latency, recent errors
Cost Dashboard Engineering manager Daily spend, service breakdown, forecast
Deployment Dashboard Release team Deploy status, rollback count, build times
Infrastructure Platform team EC2/ECS utilization, network, storage

Common Mistakes

Mistake Why It Hurts Fix
Too many metrics on one chart Hard to read Max 4-5 metrics per widget
No alarm status widget Can’t see overall health at a glance Add an alarm summary widget at the top
Dashboard per engineer Inconsistent monitoring One shared dashboard per environment
No text widget with runbook links On-call doesn’t know what to do Add runbook links and escalation info

Quick Reference

Task Command
Create/update dashboard aws cloudwatch put-dashboard --dashboard-name NAME --dashboard-body '...'
Get dashboard aws cloudwatch get-dashboard --dashboard-name NAME
List dashboards aws cloudwatch list-dashboards
Delete dashboard aws cloudwatch delete-dashboards --dashboard-names NAME

Next → CloudTrail

Updated: