AWS Certified DevOps Engineer – ProfessionalMonitoring and LoggingEasy

A DevOps team is responsible for a critical application running on Amazon EC2 instances. They need to collect detailed operating system-level metrics, such as memory utilization, disk I/O, and process-level metrics, and send them to Amazon CloudWatch for monitoring and alarming. The solution must be cost-effective and easy to deploy across a fleet of instances.

  1. AUtilize AWS Systems Manager Agent (SSM Agent) to collect all required OS metrics and forward them to CloudWatch.
  2. BInstall and configure the CloudWatch agent on each EC2 instance to collect custom metrics.
  3. CEnable detailed monitoring for the EC2 instances in the AWS Management Console to gather all OS-level metrics automatically.
  4. DDevelop custom scripts on each EC2 instance to periodically collect metrics and push them to CloudWatch using the AWS CLI.
Show answer & explanation

Correct answer: B. Install and configure the CloudWatch agent on each EC2 instance to collect custom metrics.

The CloudWatch agent is specifically designed for collecting detailed operating system-level metrics and logs from EC2 instances, on-premises servers, or other sources, and sending them to CloudWatch. It supports a wide range of custom metrics and is highly configurable.

Why the other options are wrong

  • A. While SSM Agent can manage instances, it does not directly collect and push detailed custom OS metrics to CloudWatch; the CloudWatch agent is needed for that purpose.
  • C. Detailed monitoring for EC2 instances only provides basic metrics like CPU utilization and network I/O, not detailed OS-level metrics like memory, disk I/O, or process-level data.
  • D. Custom scripts are labor-intensive to develop, maintain, and scale, and lack the robust features of the CloudWatch agent.

CloudWatch Agent

A unified agent for Amazon CloudWatch that collects metrics and logs from Amazon EC2 instances, on-premises servers, and other sources.

  • Collects detailed OS metrics (memory, disk I/O, process)
  • Collects application logs
  • Supports both Linux and Windows operating systems
  • Configurable via JSON files

Memory trick: CloudWatch Agent is the 'Swiss Army Knife' for metrics and logs.

More Monitoring and Logging questions