Troubleshooting issues in configuring CloudWatch agent in an EC2 instance
This document helps in troubleshooting the errors and issues while configuring CloudWatch agent in an EC2 Instance.
Pre-requisites
- Please follow the pre-requisites to configure the CloudWatch agent for an EC2 instance.
- Ensure you have followed all the steps mentioned in the Overview of prerequisites section.
What are the supported metrics for EC2 Instance using CloudWatch agent in Applications Manager?
Refer here to know the supported OS level metrics for an EC2 Instance in Applications Manager. However, please find the metric names in CloudWatch console for the same below: Windows
- LogicalDisk
- % Free Space
- Free Megabytes
- Memory
- % Committed Bytes In Use
- Available MBytes
- Committed Bytes
Use the below JSON while configuring the CloudWatch agent for Windows:
{ "metrics": { "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "LogicalDisk": { "measurement": [ "% Free Space", "Free Megabytes" ], "metrics_collection_interval": 300, "resources": [ "*" ] }, "Memory": { "measurement": [ "% Committed Bytes In Use", "Available MBytes", "Committed Bytes" ], "metrics_collection_interval": 300 } } } }
Linux
- Memory
- mem_total
- mem_used
- Disk
- disk_total
- disk_used
- Swap
- swap_used_percent
Use the below JSON while configuring the CloudWatch agent for Linux:
{ "metrics": { "append_dimensions": { "InstanceId": "${aws:InstanceId}" }, "metrics_collected": { "mem": { "measurement": [ "mem_total", "mem_used" ], "metrics_collection_interval": 300 }, "disk": { "resources": [ "/", "/run" ], "measurement": [ "disk_total", "disk_used" ], "metrics_collection_interval": 300 }, "swap": { "measurement": [ "swap_used_percent" ], "metrics_collection_interval": 300 } } } }
Use the JSON provided in the prerequisites to configure the CloudWatch agent. Only if all the metrics given in prerequisites are present in the CloudWatch, Applications Manager will proceed for the data collection of the OS metrics.
How to verify if the CloudWatchAgentServerRole is attached to the EC2 instance?
- Go to AWS console > EC2 > Instances > choose the instance.
- In the EC2 instance page, click Actions in the top right > Security > Modify IAM role.
- Verify whether the CloudWatchAgentServerRole is attached as mentioned in the pre-requisites step 1 & 2.
This is mandatory to allow the CloudWatch agent to send the collected data to CloudWatch.
No data for OS metrics in EC2 instance monitor in Applications Manager
- Verify if the JSON used to configure the CloudWatch agent is same as given in pre-requisites.
- Before Applications Manager version v16320, the dimension should be only 'InstanceId'; otherwise, the data will not be populated. Ensure that the configuration matches the given JSON. However, starting from Applications Manager v16320, we have removed this limitation and now support multiple dimensions.
- Ensure all the metrics mentioned in the supported metrics section is present in the namespace.
- Verify if the CWAgent namespace is present in the CloudWatch console.
- To verify, navigate to AWS console > Choose region of the EC2 Instance > CloudWatch console > Metrics > All metrics.
Reference images to verify the steps mentioned:
CWAgent namespace
Search with the instance ID > select all the metrics from result > go to Graphed metrics tab
Windows metrics
Linux metrics
- Latest Support Information File (SIF), ensure that 'print all logs' is enabled.
- Screenshot of the above mentioned information from the pre-requisites.
- JSON content used to configure the CloudWatch agent.
- Screenshot of the details (reference images from above) from AWS console.
New to ADSelfService Plus?
Related Articles
Real User Monitor (RUM) - Troubleshooting
If the monitor has not polled data for a long time, follow the steps below for troubleshooting: Step 1: Check the RUM Agent configuration Real User Monitor requires the RUM Agent to be installed and mapped to the Applications Manager. Refer the help ...
EUM Agent Troubleshooting
1. EUM Agent not mapped to Applications Manager. What should I do? If EUM Agent is not mapped, troubleshoot the problem by following the steps given below : Verify whether the EUM Agent is up and running. Check if you can reach the Applications ...
AWS EKS Troubleshooting FAQs
AWS EKS monitor can be configured only if you have already added an Amazon monitor in Applications Manager. Ensure that you have met the pre-requisites for the Amazon monitor before monitoring Elastic Kubernetes Service in Applications Manager. How ...
How to rename an existing APM - Java agent application's monitor?
In Applications Manager's APM(Application Performance Monitoring) doesn't support renaming applications/monitors from the web client. However, the application name of an existing application instance can be renamed in the `apminsight.conf` file and ...
Troubleshooting Inconsistent .NET Core monitors Availability
Issue: Some applications are experiencing inconsistent availability status, where they appear to be active but are reported as "down." This issue can occur due to the nature of application monitoring and how the monitoring agent interacts with the ...