exam questions

Exam AWS Certified Solutions Architect - Professional SAP-C02 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional SAP-C02 exam

Exam AWS Certified Solutions Architect - Professional SAP-C02 topic 1 question 458 discussion

A company wants to record key performance indicators (KPIs) from its application as part of a strategy to convert to a user-based licensing schema. The application is a multi-tier application with a web-based UI. The company saves all log files to Amazon CloudWatch by using the CloudWatch agent. All logins to the application are saved in a log file.

As part of the new license schema, the company needs to find out how many unique users each client has on a daily basis, weekly basis, and monthly basis.

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

  • A. 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.
  • B. 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.
  • C. 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.
  • D. 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.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Kaps443
2 weeks, 3 days ago
Selected Answer: D
Use a Lambda function with a CloudWatch Logs subscription to deduplicate logins and emit custom metrics or store in DynamoDB. No app change, full control, accurate unique-user tracking.
upvoted 1 times
...
Longc
1 month, 3 weeks ago
Selected Answer: D
D No Application Changes: The existing logging setup (saving logs to CloudWatch) remains unchanged. Lambda Processes Logs: A Lambda function can subscribe to the CloudWatch Logs stream, parse login events, and track unique user-client combinations. Use a database (e.g., DynamoDB with Time-to-Live) to store temporary state and ensure unique counts per period. Increment custom CloudWatch metrics with user and client dimensions for each unique login. Flexible Aggregation: CloudWatch metrics can then be aggregated (e.g., SUM, SampleCount) over daily/weekly/monthly periods. A: Metric filters cannot deduplicate logins (they count total logins, not unique users). B: Requires code changes to integrate AWS SDK calls, violating the "least change" requirement. C: The CloudWatch agent cannot natively deduplicate logins or track unique users.
upvoted 1 times
...
874def1
2 months, 3 weeks ago
Selected Answer: A
I would go with A. In May 2021 they introduced the ability to specify upto 3 dimensions. 'For example, you can use this feature to extract fields from webserver access logs allowing you to measure the bytes transferred per event type' https://aws.amazon.com/about-aws/whats-new/2021/05/amazon-cloudwatch-logs-announces-dimension-support-for-metric-filters/
upvoted 2 times
...
itsjunukim
3 months, 2 weeks ago
Selected Answer: D
Metric Filters only provide simple pattern counting functionality and cannot handle duplicate users.
upvoted 1 times
...
GabrielShiao
5 months ago
Selected Answer: A
Both A and B are workable. A is the simplest and has no code development effort
upvoted 1 times
...
0b43291
7 months, 3 weeks ago
Selected Answer: D
With https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html the documentation states that CloudWatch Logs metric filters can extract and publish metrics based on log data, but the dimensions for these metrics are limited to the following: LogGroupName LogStreamName Namespace (optional) There is no mention of the ability to use custom dimensions like user name or client name with CloudWatch Logs metric filters. Given this limitation, the solution that would provide the required information with the least change to the application is: D. 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.
upvoted 3 times
pk0619
6 months, 1 week ago
You can use up to 3 custom dimensions in cw logs metric filter and thereby capture the username and client name from the logs. https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntaxForMetricFilters.html#logs-metric-filters-dimensions
upvoted 2 times
...
...
AzureDP900
7 months, 3 weeks ago
Option A involves configuring a CloudWatch Logs metric filter to extract login metrics from log files. This approach can provide the required KPIs with minimal changes to the application, as it does not require modifying the application code or adding additional services. The solution also uses dimensions to capture user name and client name information, which will help identify unique users for each client on a daily, weekly, and monthly basis.
upvoted 3 times
...
Danm86
8 months, 1 week ago
Answer seems to be option D. Metric Filters can only count the occurrence of a pattern in the log, they cannot extract specific data fields like user name or client name. Metric Filters do not automatically create custom metrics in CloudWatch. They only send the counted values to an existing metric.
upvoted 1 times
...
chris_spencer
8 months, 3 weeks ago
Selected Answer: D
was at first for A but then for D.. ChatGPT is also for D: D: This option provides the most flexibility and capability for processing data. AWS Lambda can process the incoming log stream to apply more complex logic, such as checking for and ignoring duplicate entries within a set time frame (daily, weekly, monthly) before incrementing the metrics. This allows for the implementation of logic to ensure that users are only counted once per period, effectively tracking unique logins. Conclusion: Among the given options, Option D using an AWS Lambda function is best equipped to handle the requirement of counting unique user logins accurately over specified periods. Lambda functions offer the flexibility to implement any necessary logic to filter duplicates and manage counts over time, aligning with the need to track unique users on a daily, weekly, and monthly basis.
upvoted 2 times
...
Syre
9 months, 3 weeks ago
Selected Answer: D
A is not because Metric filters can't directly solve the problem of counting unique users across different time periods. They can count how many logins happened, but not how many distinct users logged in during those time periods.
upvoted 4 times
...
thotwielder
1 year, 2 months ago
Selected Answer: A
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html
upvoted 4 times
...
VerRi
1 year, 3 months ago
Selected Answer: A
With existing logs, we don't have to make changes to the application.
upvoted 1 times
...
pangchn
1 year, 3 months ago
Selected Answer: A
I would go for A https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringPolicyExamples.html
upvoted 1 times
...
AWSPro1234
1 year, 3 months ago
Answer is C.
upvoted 2 times
...
Dgix
1 year, 3 months ago
Selected Answer: A
A is the correct answer: it has the least changes to the application. C and D are rubbish.
upvoted 2 times
...
CMMC
1 year, 3 months ago
Selected Answer: C
No app code change by configuring the agent to extract & save successful login metrics as custom metrics with user name and client name dimensions. #A and #B requires app changes. #D needs additional lamba infra and increase complexity
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...