Created
February 25, 2021 15:19
-
-
Save Insidexa/eaa0899edaa323ccb95c0842ec7c9b3b to your computer and use it in GitHub Desktop.
cloudwatch memory usage ( CloudFormation, Elastic Beanstalk )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources: | |
CloudWatchRamDashboard: | |
Type: 'AWS::CloudWatch::Dashboard' | |
Properties: | |
DashboardName: !Sub '${ProjectId}-board' | |
DashboardBody: !Sub >- | |
{ | |
"widgets": [ | |
{ | |
"type": "metric", | |
"properties": { | |
"metrics": [ | |
[ | |
{ | |
"expression": "SEARCH('{${ProjectId}-backend,RAMPercent,InstanceId} MetricName=mem_used', 'Average', 30)", | |
"region": "us-east-1", | |
"label": "${!PROP('Dim.InstanceId')} used" | |
} | |
], | |
[ | |
{ | |
"expression": "SEARCH('{${ProjectId}-backend,RAMPercent,InstanceId} MetricName=mem_total', 'Average', 30)", | |
"region": "us-east-1", | |
"label": "${!PROP('Dim.InstanceId')} total" | |
} | |
] | |
], | |
"region": "${AWS::Region}", | |
"period": 300, | |
"view": "timeSeries", | |
"stat": "Average", | |
"stacked": false, | |
"title": "${ProjectId}-backend-ram", | |
"setPeriodToTimeRange": true | |
} | |
}, | |
{ | |
"type": "metric", | |
"properties": { | |
"metrics": [ | |
[ | |
{ | |
"expression": "SEARCH('{${ProjectId}-worker,RAMPercent,InstanceId} MetricName=mem_used', 'Average', 30)", | |
"region": "us-east-1", | |
"label": "${!PROP('Dim.InstanceId')} used" | |
} | |
], | |
[ | |
{ | |
"expression": "SEARCH('{${ProjectId}-worker,RAMPercent,InstanceId} MetricName=mem_total', 'Average', 30)", | |
"region": "us-east-1", | |
"label": "${!PROP('Dim.InstanceId')} total" | |
} | |
] | |
], | |
"region": "${AWS::Region}", | |
"period": 300, | |
"view": "timeSeries", | |
"stat": "Average", | |
"stacked": false, | |
"title": "${ProjectId}-worker-ram", | |
"setPeriodToTimeRange": true | |
} | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"agent": { | |
"metrics_collection_interval": 30, | |
"run_as_user": "root" | |
}, | |
"metrics": { | |
"namespace": "${ProjectId}", // replace ${ProjectId} to custom namespace name and remove this comment | |
"append_dimensions": { | |
"InstanceId": "${aws:InstanceId}" | |
}, | |
"metrics_collected": { | |
"mem": { | |
"append_dimensions": { | |
"RAMPercent": "${ProjectId}-ram" // replace ${ProjectId} to custom namespace name and remove this comment | |
}, | |
"measurement": [ | |
{ "name": "mem_total", "unit": "Percent" }, | |
{ "name": "mem_used", "unit": "Percent" } | |
], | |
"metrics_collection_interval": 30 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment