Skip to content

Commit 727bd28

Browse files
committed
Add AWS memory monitoring
1 parent b39182b commit 727bd28

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.ebextensions/cloudwatch.config

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-cw.html
2+
3+
files:
4+
"/opt/aws/amazon-cloudwatch-agent/bin/config.json":
5+
mode: "000600"
6+
owner: root
7+
group: root
8+
content: |
9+
{
10+
"agent":{
11+
"metrics_collection_interval":60,
12+
"logfile":"/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
13+
"run_as_user":"cwagent"
14+
},
15+
"metrics":{
16+
"namespace":"CWAgent/AppBuilderData",
17+
"append_dimensions":{
18+
"InstanceId":"${aws:InstanceId}",
19+
"InstanceType":"${aws:InstanceType}",
20+
"AutoScalingGroupName":"${aws:AutoScalingGroupName}"
21+
},
22+
"aggregation_dimensions":[
23+
[
24+
"AutoScalingGroupName", "InstanceId"
25+
],
26+
[
27+
28+
]
29+
],
30+
"metrics_collected":{
31+
"cpu":{
32+
"resources":[
33+
"*"
34+
],
35+
"measurement":[
36+
"time_idle",
37+
"time_iowait",
38+
"time_system",
39+
"time_user",
40+
"usage_steal",
41+
"usage_system",
42+
"usage_user",
43+
"usage_iowait"
44+
]
45+
},
46+
"mem":{
47+
"measurement":[
48+
"used_percent",
49+
"total",
50+
"available_percent"
51+
]
52+
}
53+
}
54+
}
55+
}
56+
container_commands:
57+
start_cloudwatch_agent:
58+
command: /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json

0 commit comments

Comments
 (0)