Skip to content

Commit

Permalink
[IT-3471] Setup cloudwatch dashboard
Browse files Browse the repository at this point in the history
Setup a cloudwatch dashboard containing metrics from Elastic beanstalk
enhanced health checks.

depends on Sage-Bionetworks#25
  • Loading branch information
zaro0508 committed Apr 5, 2024
1 parent 134dc99 commit 292469c
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ repos:
rev: v1.1.0
hooks:
- id: j2lint
# args: [--ignore, S3, V1, --]
args: [--ignore, V1, --]
9 changes: 9 additions & 0 deletions config/agoradev/develop/agora-dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
template:
path: cw-dashboard.j2
stack_name: agora-develop-dashboard
stack_tags:
Environment: "develop"
dependencies:
- agoradev/develop/agora.yaml
sceptre_user_data:
BeanstalkEnvironmentName: "agora-develop"
9 changes: 9 additions & 0 deletions config/agoraprod/prod/agora-dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
template:
path: cw-dashboard.j2
stack_name: agora-staging-dashboard
stack_tags:
Environment: "prod"
dependencies:
- agoraprod/prod/agora.yaml
sceptre_user_data:
BeanstalkEnvironmentName: "agora-prod"
9 changes: 9 additions & 0 deletions config/agoraprod/staging/agora-dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
template:
path: cw-dashboard.j2
stack_name: agora-staging-dashboard
stack_tags:
Environment: "staging"
dependencies:
- agoraprod/staging/agora.yaml
sceptre_user_data:
BeanstalkEnvironmentName: "agora-staging"
71 changes: 71 additions & 0 deletions templates/cw-dashboard.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
AWSTemplateFormatVersion: 2010-09-09
Description: Cloudwatch Dashboards
Resources:
Dashboard:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardName: {{ sceptre_user_data.BeanstalkEnvironmentName }}
DashboardBody: >
{
"widgets": [
{
"type": "metric",
"width": 20,
"height": 6,
"properties": {
"metrics": [
[
"AWS/ElasticBeanstalk",
"EnvironmentHealth",
"EnvironmentName",
"{{ sceptre_user_data.BeanstalkEnvironmentName }}",
{
"period": 300,
"stat": "Average",
"region": "us-east-1"
}
]
],
"legend": {
"position": "bottom"
},
"region": "us-east-1",
"liveData": false,
"title": "EnvironmentHealth: Average",
"view": "timeSeries",
"stacked": false
}
},
{
"type": "metric",
"properties": {
"metrics": [
[
"AWS/ElasticBeanstalk",
"ApplicationRequests2xx",
"EnvironmentName",
"{{ sceptre_user_data.BeanstalkEnvironmentName }}",
{
"period": 300,
"stat": "Average",
"region": "us-east-1"
}
]
],
"legend": {
"position": "bottom"
},
"region": "us-east-1",
"liveData": false,
"title": "ApplicationRequests2xx: Average",
"view": "timeSeries",
"stacked": false
}
}
]
}
Outputs:
Dashboard:
Value: !Ref Dashboard
Export:
Name: !Sub '${AWS::Region}-${AWS::StackName}-Dashboard'

0 comments on commit 292469c

Please sign in to comment.