Question #1025
A company operates an application on Amazon EC2 instances within an Auto Scaling group. The application's workload fluctuates significantly during peak hours.
The company needs to gather comprehensive metrics from the EC2 instances to optimize instance performance. Additionally, they must monitor custom metrics from the application to maintain operational efficiency.
Which solution fulfills these requirements?
Deploy the AWS X-Ray agent on the instances. Configure the agent to collect EC2 instance performance data and custom application metrics.
Install the Amazon CloudWatch agent on the instances. Configure the agent to collect detailed EC2 instance metrics and custom application metrics.
Integrate the AWS SDK into the application code. Modify the application to use the SDK for publishing EC2 instance metrics and custom application metrics.
Enable AWS CloudTrail to capture and analyze EC2 instance performance data and custom application metrics.
Explanation
Answer B is correct because:
1. Amazon CloudWatch Agent collects detailed EC2 metrics (e.g., memory, disk, processes) at 1-minute granularity, which is essential for optimizing instance performance during fluctuating workloads.
2. The agent can also collect custom application metrics (e.g., application logs, business metrics) by configuring custom metrics files, ensuring operational efficiency.
Why other options are incorrect:
- A (AWS X-Ray): X-Ray focuses on tracing application requests, not system-level or custom metrics.
- C (AWS SDK): While custom metrics can be published via the SDK, EC2 instance metrics are better handled by CloudWatch Agent without code modifications.
- D (CloudTrail): CloudTrail logs API activity, not performance or application metrics.
Key Points:
- Use CloudWatch Agent for detailed EC2 metrics and custom application monitoring.
- X-Ray is for tracing, CloudTrail for auditing, and SDK requires code changes.
Answer
The correct answer is: B