AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 1

A company has a mobile application that makes HTTP API calls to an Application Load Balancer (ALB). The ALB routes requests to an AWS Lambda function. Many different versions of the application are in use at any given time, including versions that are in testing by a subset of users. The version of the application is defined in the user-agent header that is sent with all requests to the API.
After a series of recent changes to the API, the company has observed issues with the application. The company needs to gather a metric for each API operation by response code for each version of the application that is in use. A DevOps engineer has modified the Lambda function to extract the API operation name, version information from the user-agent header and response code.
Which additional set of actions should the DevOps engineer take to gather the required metrics?

Answer options

Correct answer: A

Explanation

The correct answer is A because it directly logs the relevant information to CloudWatch Logs and sets up a metric filter to create custom metrics based on that log data. Option B is incorrect as it relies on CloudWatch Logs Insights, which is not suitable for real-time metrics collection needed in this scenario. Option C does not utilize the Lambda function's logging capabilities directly for metric collection, while option D introduces unnecessary complexity with X-Ray when simpler logging could suffice.