How to Setup Cloudwatch Agent on EC2s

Cloudwatch metrics is so useful but also just short of providing the memory (RAM) utilisation. To get that, we have to install Cloudwatch Agent on the instances.

Steps

Here are the steps to do it, in overview:

  • Download the CloudWatch agent package

List of commands for Amazon Linux machines:

  • sudo yum install amazon-cloudwatch-agent

For specifics, please see the official aws documentation here. If you are very lost, this video can help.

Cost

If you are worried about cost, this is what you can expect:

  • Put requests from EC2s to Cloudwatch: $0.00 per request for first 1,000,000 requests $0.00 per request — first 1,000,000 requests $0.00 per metric-month — first 10 metrics $0.00 per metric-month — first 10 metrics $0.00 per metric-month — first 10 metrics

Let’s say you have a few dozens of EC2, it is only going to cost you a couple of dollars per month.

Benefits

Once you set it up, rightsizing will be a breeze. The metrics data will contribute towards:

  • AWS CloudWatch

Now you face the happier problem of too much information and cannot decide😂

You can monitor your EBS disk utilization with Cloudwatch agent, on Cloudwatch

Typically seen messing around with AWS