A simple dashboard for rendering graphs of AWS Cloudwatch metrics.
The metrics to graph are configured in the dashboard_config.yml file.
Metrics are divided up by namespace, and each namespace graphs are rendered on different pages.
To render a graph of the aggregated average CPUUtilization across your EC2 instances
metrics: {
"AWS/EC2": [
{
title: "CPUUtilization",
period: 3600,
left: {
label: "CPU",
metrics: [{metric_name: "CPUUtilization",statistics: ['Average']]
}
}
]
}
You can graph multiple metrics on the same graph.
To graph of your ELB response codes together on the same graph
metrics: {
"AWS/ELB": [
{ title: "ELB - Response Codes",
period: 300,
left: {
label: "Count",
metrics: [
{metric_name: "HTTPCode_Backend_2XX",statistics: ['Sum']},
{metric_name: "HTTPCode_Backend_3XX", statistics: ['Sum']},
{metric_name: "HTTPCode_Backend_4XX", statistics: ['Sum']},
{metric_name: "HTTPCode_Backend_5XX", statistics: ['Sum']}
]
}
}
]
}
To draw a graph of ELB Latency (on the left) and ELB Request Count (on the right)
metrics: {
"AWS/ELB": [
{ title: "ELB - Requests/Latency",
period: 3600,
left: {
label: "Latency",
metrics: [{metric_name: "Latency", statistics: ['Average']}]
},
right: {
label: "Requests",
metrics: [{metric_name: "RequestCount",statistics: ['Sum']}]
}
}
]
}
You can add multiple (per namespace) graphs on the same page
metrics: {
"AWS/ELB": [
{ title: "ELB - Requests/Latency",
period: 3600,
left: {
label: "Latency",
metrics: [{metric_name: "Latency", statistics: ['Average']}]
},
right: {
label: "Requests",
metrics: [{metric_name: "RequestCount",statistics: ['Sum']}]
}
},
{ title: "ELB - Response Codes",
period: 300,
left: {
label: "Count",
metrics: [
{metric_name: "HTTPCode_Backend_2XX",statistics: ['Sum']},
{metric_name: "HTTPCode_Backend_3XX", statistics: ['Sum']},
{metric_name: "HTTPCode_Backend_4XX", statistics: ['Sum']},
{metric_name: "HTTPCode_Backend_5XX", statistics: ['Sum']}
]
}
}
]
}
This implementation has some limitations for my use-case, but feel free to send on pull requests with your enhancements
- Single Region (eu-west-1)
- Static date range (fixed to last 3 days)
- Graphs are grouped per namespace
-
Configure some metrics in
dashboard_config.yml
-
Configure environment variables for access/secret key. They are configured as ENV variables to make deployment to heroku simple
$ bundle install
$ export AWS_ACCESS_KEY_ID=you-aws-access-key
$ export AWS_SECRET_KEY_ID=your-aws-secret-key
- Run sinatra server
$ ruby dashboard.rb
- Open web browser to (http://localhost:4567)
You can easily deploy to Heroku using the usual steps and set the AWS_ACCCESS_KEY and AWS_SECRET_KEY environment variables.
- Highcharts
- Sinatra
- Twitter Bootstrap



