Which solution will provide this information with the LEAST change to the application?
Configure an Amazon CloudWatch Logs metric filter that saves each successful login as a metric. Configure the user name and client name as dimensions for the metric.
Change the application logic to make each successful login generate a call to the AWS SDK to increment a custom metric that records user name and client name dimensions in CloudWatch.
Configure the CloudWatch agent to extract successful login metrics from the logs. Additionally, configure the CloudWatch agent to save the successful login metrics as a custom metric that uses the user name and client name as dimensions for the metric.
Configure an AWS Lambda function to consume an Amazon CloudWatch Logs stream of the application logs. Additionally, configure the Lambda function to increment a custom CloudWatch that uses the user name and client name as dimensions for the metric.
Explanations:
Configuring a CloudWatch Logs metric filter to capture logins and define the user and client as dimensions will allow the company to track unique users on a daily, weekly, and monthly basis. It requires minimal change to the application and leverages existing log data.
Changing the application logic to call the AWS SDK on each login would require significant changes to the application code and may increase overhead. This solution is more intrusive and complex than necessary.
Configuring the CloudWatch agent to extract and create custom metrics directly from the logs would require customization beyond the default CloudWatch agent capabilities, potentially needing extra configuration or even code modifications.
Using an AWS Lambda function to consume CloudWatch Logs and increment a custom metric requires developing and maintaining a Lambda function, which introduces complexity and additional components. This is more involved than using metric filters.