Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidrosenstark/7483a4c888fad4ed054e1b84d7fab572 to your computer and use it in GitHub Desktop.
Save davidrosenstark/7483a4c888fad4ed054e1b84d7fab572 to your computer and use it in GitHub Desktop.
---
AWSTemplateFormatVersion: '2010-09-09'
Description: "Monitoring - Dashboard - Http Errors"
Parameters:
EnvironmentName:
Type: String
Resources:
dashboard:
Type: 'AWS::CloudWatch::Dashboard'
Properties:
DashboardName: !Sub "${EnvironmentName}-server-errors"
DashboardBody:
!Sub
'{
"widgets": [
{
"type": "log",
"x": 0,
"y": 0,
"width": 24,
"height": 6,
"properties": {
"query": "SOURCE ''/${EnvironmentName}/access-logs'' | filter status >= 400 and status <= 499\n| stats count(*) as count by resourcePath as url, status, bin(5m)",
"region": "${AWS::Region}",
"title": "4xx errors"
}
},
{
"type": "log",
"x": 0,
"y": 6,
"width": 24,
"height": 6,
"properties": {
"query": "SOURCE ''/${EnvironmentName}/access-logs'' | filter status >= 500 and status <= 599\n| stats count(*) as count by resourcePath as url, status, bin(5m)",
"region": "${AWS::Region}",
"title": "5xx errors"
}
}
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment