A Java application runs on ECS Fargate (port 8080); JVM metrics are exposed on port 9404. You want to scale the service based on the JVM thread count with minimal operational overhead. Which two approaches meet this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Run the Amazon CloudWatch agent as a sidecar container, configure it to scrape JVM metrics from port 9404, create CloudWatch alarms on the JVM thread-count metric, and add a step-scaling policy in Fargate driven by those alarms., Create an Amazon Managed Service for Prometheus workspace and deploy AWS Distro for OpenTelemetry as a sidecar to publish JVM metrics from port 9404 to the workspace. Use a target-tracking policy in Fargate that selects the Prometheus metric as the scale target..
Why this is the answer
The first correct option leverages the CloudWatch agent as a sidecar to scrape custom metrics directly from the application's exposed port. These metrics are then sent to CloudWatch, where alarms can be set to trigger a step-scaling policy for the Fargate service. This is a direct and efficient way to use existing AWS services for custom metric-based scaling. The second correct option utilizes Amazon Managed Service for Prometheus (AMP) with AWS Distro for OpenTelemetry (ADOT) as a sidecar. ADOT collects the JVM metrics and pushes them to AMP. Fargate's target-tracking scaling policies can directly consume metrics from AMP, providing a robust and scalable solution for monitoring and scaling based on Prometheus metrics. The incorrect option involving a metric filter from logs is less efficient and potentially less accurate for real-time thread count monitoring compared to direct metric scraping. The other incorrect option, using Prometheus rules with a step-scaling policy, is not how Fargate's scaling policies directly integrate with Prometheus metrics for scaling. Fargate scaling policies typically consume metrics directly, not rules.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed