Collecting metrics using Amazon CloudWatch

You can use the CloudWatch agent to collect the system-level metrics from your AWS EC2 instances. Custom metrics are required if you want to collect metric data at a resolution that is lower than 5 minutes. The CloudWatch agent collects these metrics and sends them to Amazon CloudWatch. These metrics are useful for investigating the resource related issues that might occur in your AWS cloud environment.

To create the IAM role for an administrator to save an agent configuration file to Systems Manager Parameter Store

The details are as follows:

    1. Create IAM roles and users. These roles and users permit the CloudWatch agent to send metrics to CloudWatch. For information, see Create IAM Roles and Users for Use With CloudWatch Agent. Open link
    2. Install the CloudWatch agent on the EC2 instances. For information, see Getting Started: Installing the CloudWatch Agent on Your First Instance Open link .
    3. Verify that the CloudWatch agent service is up and running:
      • (Windows) Open Windows services, and check whether the service is running.
      • (Linux) Run this command: sudo /bin/systemctl status amazon-cloudwatch-agent.service
    4. Verify that the CloudWatch agent is started:
      • (Windows) <agent_installation_directory_path>\amazon-cloudwatch-agent-ctl -m ec2 -a status
        For example, C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent-ctl -m ec2 -a status
      • (Linux) <agent_installation_directory_path>/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a status
        For example, sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a status
    5. Download the attached agent configuration file that contains the metrics to be collected by the agent.
      1. Log in to the EC2 instance.
      2. Download the attached json file.
      3. Rename the file as amazon-cloudwatch-agent and save it at the following location:
        • (Windows) AmazonCloudWatchAgent\bin
        • (Linux) amazon-cloudwatch-agent/bin
    6. Run the following command to start data collection:
      • (Windows) <agent_installation_directory_path>\amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent.json -s
        For example, C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:C:\Program Files\Amazon\AmazonCloudWatchAgent\bin\amazon-cloudwatch-agent.json -s
      • (Linux) <agent_installation_directory_path>/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent.json -s
        For example, sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent.json -s
      The agent starts collecting metrics and data from EC2 instances and sends them to CloudWatch.

    You can create your own agent configuration file and use it to start the agent on all your EC2 instances. For more information, see Installing CloudWatch Agent on Additional Instances Using Your Agent Configuration Open link .

    To troubleshoot issues with the CloudWatch agent, see Troubleshooting the CloudWatch Agent Open link .

  1. Configure and run the connector. For information, see Amazon Web Services connector

The following table lists the basic metrics that are available from Amazon CloudWatch:

BMC Helix Cloud Cost metric

UnitAWS metricAWS service name
NET_TRANSFER_RATEbyte/sec

Derived
Network In + Network Out
(Average, Bytes)

EC2
DISK_TRANSFER_RATEbyte/sec

Derived
Disk Read Bytes + Disk Write Bytes
(Average, Bytes)

EC2
CPU_SIZEcores

CPUOptions.CoreCount 


EC2
CPU_USEDcores fraction

Derived
CPU_SIZE x CPU_UTIL

EC2
CPU_UTIL%

CPUUtilization

EC2, RDS
DISK_IO_RATEcount/sec

Derived
WriteIOPS + ReadIOPS

RDS
DB_CONNECTIONScountDatabaseConnectionsRDS
NETWORK_THROUGHPUT_RATEbyte/secNetworkReceiveThroughput + NetworkTransmitThroughputRDS

The following table lists the metrics that are available when the CloudWatch agent is installed:

BMC Helix Cloud Cost metric

UnitAWS metricAWS service name
MEMORY_SIZEbytes

mem_total

EC2
MEMORY_USEDbytes

Derived
mem_used
mem_total = mem_free - (mem_buffered+ mem_cached)

EC2
Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Mohan Mohan Yadav

    CPU_UTIL is mapped two times with different metrics and one of them, Percentage CPU, is not AWS metric so please remove below entry in mapping table

    CPU_UTIL % Percentage CPU

    May 21, 2020 07:29
    1. Shweta Patil

      Thank you for your comment, Mohan. I have updated the documentation. 

      May 21, 2020 07:34
      1. Mohan Mohan Yadav

        Thanks

        May 22, 2020 07:31
  2. Kunal Panigrahi

    Can we update this section to show what are the default metrics we collect without CloudWatch agent and what is added after installing cloudwatch agent.

    Idle VM recommendations (EC2 CPU) is collected by default but other RDS, Memory related metrics are captured by Cloud Watch agent only - we need to make this very clear. Storage metrics are not captured by CloudWtch agent in AWS but similar information is shown by default in Azure. Jaga to confirm and check.

    Nov 22, 2021 07:27