CloudWatch Agents Overview:
- Purpose: CloudWatch Agents are deployed on EC2 instances to facilitate the collection and transfer of log files and metrics to AWS CloudWatch.
- Setup Requirements: EC2 instances must be equipped with an IAM role that grants permission to send logs and metrics to CloudWatch. These agents can also be installed on on-premises servers, allowing integration of logs from systems outside of AWS.
Types of CloudWatch Agents:
- CloudWatch Logs Agent: The older version of the agent solely handles log data transfer to CloudWatch Logs. (deprecated)
- CloudWatch Unified Agent: A more advanced option that not only sends logs but also collects a broad array of system metrics, such as CPU usage details, disk I/O, RAM statistics, network stats, and swap space usage. This agent provides greater granularity in monitoring and can be centrally configured via the AWS Systems Manager (SSM) Parameter Store.
Advantages of the Unified Agent:
- Enhanced Monitoring: Offers detailed metrics that are not available by default on EC2, such as memory and swap usage.
- Centralized Configuration: Allows for easier management of agent settings across multiple instances using SSM Parameter Store.
Key Metrics Collected by the Unified Agent:
- CPU Metrics: Includes detailed statistics like active, guest, idle, system, user, and steal time.
- Disk Metrics: Tracks usage, free space, total space, as well as detailed I/O statistics.
- RAM and Swap Metrics: Provides detailed memory usage including free, used, total, and cached RAM, along with swap space utilization.
- Network Statistics: Offers insights into TCP and UDP connections, packet transfers, and more.
Practical Implications:
- For enhanced system monitoring beyond the default EC2 capabilities, the CloudWatch Unified Agent is recommended due to its comprehensive data collection features. This setup is essential for advanced performance monitoring and operational troubleshooting in AWS environments.
This session underscores the importance of using the CloudWatch Unified Agent for a more granular and detailed approach to monitoring AWS resources, facilitating better performance optimization and operational efficiency.