AWS Certified Solutions Architect - Professional / Question #987 of 529

Question #987

A company wants to track feature usage metrics from its application to transition to a usage-based pricing model. The application is a multi-tier system with a web-based UI, and all user interactions are logged to Amazon CloudWatch using the CloudWatch agent. Each feature access event is recorded in the logs with the user ID and feature name.

As part of the new pricing model, the company needs to determine the number of unique features each user accesses on a daily, weekly, and monthly basis.

Which solution will provide this information with the LEAST change to the application?

A

Configure an Amazon CloudWatch Logs metric filter to extract feature access events from the logs. Set the user ID and feature name as dimensions for the metric.

B

Modify the application logic to trigger an AWS SDK call for each feature access event. Use the SDK to increment a custom CloudWatch metric with user ID and feature name dimensions.

C

Update the CloudWatch agent configuration to parse feature access events from the logs. Configure the agent to publish these events as custom CloudWatch metrics with user ID and feature name dimensions.

D

Create an AWS Lambda function to process the Amazon CloudWatch Logs stream. Program the Lambda function to aggregate feature access events and update a custom CloudWatch metric with user ID and feature name dimensions.

Explanation

Answer A is correct because:
1. Least Application Change: The application already logs feature access events to CloudWatch. A metric filter extracts data directly from logs, avoiding code modifications (unlike Option B) or agent reconfiguration (Option C).
2. Dimensions for Aggregation: By setting user ID and feature name as dimensions, CloudWatch can track unique feature-user combinations. Using CloudWatch Metrics' built-in aggregation (e.g., COUNT_DISTINCT), daily/weekly/monthly unique counts are calculated.
3. Simpler Architecture: Option D introduces Lambda and custom code, adding complexity. Option A leverages CloudWatch's native capabilities.

Why others are incorrect:
- B: Requires SDK integration and code changes.
- C: May need agent reconfiguration and lacks clarity on dimension extraction.
- D: Adds Lambda processing overhead and maintenance.

Key Points: Use CloudWatch metric filters to transform logs into metrics with dimensions for minimal changes. Avoid code/architecture changes when native services suffice.

Answer

The correct answer is: A