Skip to content

Commit 87e7794

Browse files
committed
custom metrics recieved from cloudwatch
1 parent 00b641c commit 87e7794

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/deploy-prod.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- multitenancy
7-
- cloudwatch-dashboard
87

98
jobs:
109
deploy:

infrastructure/modules/monitoring/main.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ resource "aws_cloudwatch_dashboard" "main" {
3232
type = "metric"
3333
properties = {
3434
metrics = [
35-
["CWAgent", "MemoryUtilization", "AutoScalingGroupName", var.eb_autoscaling_group_name, { stat = "Average" }]
35+
[{ expression = "SELECT AVG(MemoryUtilization) FROM \"CWAgent\"", id = "m1" }]
3636
]
3737
period = 300
38-
stat = "Average"
3938
region = var.aws_region
4039
title = "EC2 Memory Utilization (%)"
4140
yAxis = {
@@ -46,17 +45,16 @@ resource "aws_cloudwatch_dashboard" "main" {
4645
}
4746
}
4847
},
49-
# EC2 Disk Utilization (Custom Metric)
48+
# EC2 Disk Utilization (Custom Metric) - Root filesystem
5049
{
5150
type = "metric"
5251
properties = {
5352
metrics = [
54-
["CWAgent", "DiskUtilization", "AutoScalingGroupName", var.eb_autoscaling_group_name, { stat = "Average" }]
53+
[{ expression = "SELECT AVG(DiskUtilization) FROM \"CWAgent\" WHERE path = '/'", id = "m1" }]
5554
]
5655
period = 300
57-
stat = "Average"
5856
region = var.aws_region
59-
title = "EC2 Disk Utilization (%)"
57+
title = "EC2 Disk Utilization (%) - Root"
6058
yAxis = {
6159
left = {
6260
min = 0

0 commit comments

Comments
 (0)