Skip to Content

SOA-C02: What should SysOps do to create CloudWatch dashboard automatically display CPU metrics of EC2 instances in Auto Scaling group

Question

A company runs an application on Amazon EC2 instances behind an Application Load Balancer. The EC2 instances are in an Auto Scaling group. The application sometimes becomes slow and unresponsive. Amazon CloudWatch metrics show that some EC2 instances are experiencing high CPU load.

A SysOps administrator needs to create a CloudWatch dashboard that can automatically display CPU metrics of all the EC2 instances. The metrics must include new instances that are launched as part of the Auto Scaling group. What should the SysOps administrator do to meet these requirements in the MOST operationally efficient way?

A. Create a CloudWatch dashboard. Use activity notifications from the Auto Scaling group to invoke a custom AWS Lambda function. Use the Lambda function to update the CloudWatch dashboard to monitor the CPUUtilization metric for the new instance IDs.
B. Create a CloudWatch dashboard. Run a custom script on each EC2 instance to stream the CPU utilization to the dashboard.
C. Use CloudWatch metrics explorer to filter by the aws:autoscaling:groupName tag and to create a visualization for the CPUUtilization metric. Add the visualization to a CloudWatch dashboard.
D. Use CloudWatch metrics explorer to filter by instance state and to create a visualization for the CPUUtilization metric. Add the visualization to a CloudWatch dashboard.

Answer

C. Use CloudWatch metrics explorer to filter by the aws:autoscaling:groupName tag and to create a visualization for the CPUUtilization metric. Add the visualization to a CloudWatch dashboard.

Explanation

The correct answer is C. Use CloudWatch metrics explorer to filter by the aws:autoscaling:groupName tag and to create a visualization for the CPUUtilization metric. Add the visualization to a CloudWatch dashboard.

CloudWatch metrics explorer is a feature that enables you to discover, analyze, and visualize metrics from multiple AWS services and resources in one place. You can use metrics explorer to filter metrics by various dimensions, such as tags, regions, namespaces, or resource types. You can also use metrics explorer to create custom visualizations, such as charts, graphs, or tables, for the metrics that you are interested in. You can then add these visualizations to a CloudWatch dashboard, which is a customizable web page that displays the status and performance of your AWS resources.

To use metrics explorer to create a dashboard that can automatically display CPU metrics of all the EC2 instances in an Auto Scaling group, you need to follow these steps:

  1. Open the CloudWatch console and choose Metrics from the navigation pane.
  2. Choose Metrics explorer from the top menu.
  3. In the Filter by section, select Tags as the filter type.
  4. In the Tag key field, enter aws:autoscaling:groupName as the tag key that identifies your Auto Scaling group.
  5. In the Tag value field, enter the name of your Auto Scaling group.
  6. In the Metrics section, select CPUUtilization as the metric that you want to monitor.
  7. In the Visualization section, choose the type of visualization that you want to create, such as a line chart or a bar chart.
  8. Choose Add to dashboard from the Actions menu.
  9. Choose an existing dashboard or create a new one.
  10. Choose Add widget to add the visualization to the dashboard.

By using this solution, you can create a CloudWatch dashboard that can automatically display CPU metrics of all the EC2 instances in an Auto Scaling group, including new instances that are launched as part of the group. This solution is the most operationally efficient one, as it does not require you to write any custom code or use any additional services. It also leverages the existing functionality and scalability of CloudWatch metrics explorer and CloudWatch dashboards.

The other options are not correct for the following reasons:

A. Create a CloudWatch dashboard. Use activity notifications from the Auto Scaling group to invoke a custom AWS Lambda function. Use the Lambda function to update the CloudWatch dashboard to monitor the CPUUtilization metric for the new instance IDs.

This option is not operationally efficient, as it requires you to write and maintain a custom Lambda function that will perform the dashboard update logic. It also does not leverage the existing functionality and scalability of CloudWatch metrics explorer and CloudWatch dashboards.

B. Create a CloudWatch dashboard. Run a custom script on each EC2 instance to stream the CPU utilization to the dashboard.

This option is not operationally efficient, as it requires you to run and manage a custom script on each EC2 instance that will stream the CPU utilization data. It also does not leverage the existing functionality and scalability of CloudWatch metrics explorer and CloudWatch dashboards.

D. Use CloudWatch metrics explorer to filter by instance state and to create a visualization for the CPUUtilization metric. Add the visualization to a CloudWatch dashboard.

This option is not correct, as filtering by instance state will not capture all the EC2 instances in an Auto Scaling group. Instance state is a dimension that indicates whether an instance is running, stopped, terminated, or pending. It does not indicate whether an instance belongs to an Auto Scaling group or not. Therefore, filtering by instance state may include instances that are not part of the group or exclude instances that are part of the group. The correct dimension to filter by is aws:autoscaling:groupName, which identifies an Auto Scaling group by its name.

Reference

Amazon AWS Certified SysOps Administrator – Associate certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified SysOps Administrator – Associate exam and earn Amazon AWS Certified SysOps Administrator – Associate certification.