AWS Certified Developer – Associate — Question 23
A Developer has written an application that runs on Amazon EC2 instances and generates a value every minute. The Developer wants to monitor and graph the values generated over time without logging in to the instance each time.
Which approach should the Developer use to achieve this goal?
Answer options
- A. Use the Amazon CloudWatch metrics reported by default for all EC2 instances. View each value from the CloudWatch console.
- B. Develop the application to store each value in a file on Amazon S3 every minute with the timestamp as the name.
- C. Publish each generated value as a custom metric to Amazon CloudWatch using available AWS SDKs.
- D. Store each value as a variable and add the variable to the list of EC2 metrics that should be reported to the Amazon CloudWatch console.
Correct answer: C
Explanation
The correct answer is C because publishing each generated value as a custom metric to Amazon CloudWatch enables real-time monitoring and graphing without needing to log into the instance. Option A only provides default metrics, which may not include the specific values generated by the application. Option B involves storing data in S3, which does not provide immediate monitoring or graphing capabilities. Option D does not specify how to report the variable to CloudWatch effectively, making it less efficient.