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 metric in CloudWatch that uses the user name and client name as dimensions for the metric.
Explanations:
This option utilizes a CloudWatch Logs metric filter to extract successful login events from the logs without modifying the application code. By configuring dimensions for user name and client name, it allows for easy tracking of unique users on a daily, weekly, and monthly basis while keeping changes minimal.
This option requires modifying the application logic to directly call the AWS SDK on every successful login. This introduces significant changes to the application and increases the risk of bugs or performance issues. Additionally, it may complicate the licensing implementation.
While this option involves minimal changes to the existing CloudWatch agent configuration, it still requires significant alterations. The CloudWatch agent does not natively support metric extraction based on custom logic from logs; it is typically used for more straightforward metric collection and might require additional setup or third-party tools to achieve the desired outcomes.
This option involves deploying a Lambda function that processes CloudWatch Logs, which requires additional infrastructure and complexity. Although it can capture login events, it introduces latency and complexity in managing the function. This is more invasive than simply configuring a metric filter.