You want to organize logs from multiple microservices in CloudWatch Logs. Which approach best follows AWS best practices?
hard📝 Best Practice Q15 of 15
AWS - CloudWatch
You want to organize logs from multiple microservices in CloudWatch Logs. Which approach best follows AWS best practices?
AStore all logs in a single log stream for simplicity
BCreate one log stream for all microservices in a single log group
CCreate one log group per instance and one log stream per microservice
DCreate one log group per microservice and multiple log streams per instance
Step-by-Step Solution
Solution:
Step 1: Understand log group and stream organization
Best practice is to use log groups to separate different applications or microservices.
Step 2: Assign log streams per instance or source
Within each log group, use multiple log streams to separate logs by instance or container.
Step 3: Evaluate options
Create one log group per microservice and multiple log streams per instance matches best practice: one log group per microservice, multiple streams per instance.
Final Answer:
Create one log group per microservice and multiple log streams per instance -> Option D
Quick Check:
Group per microservice, streams per instance [OK]
Quick Trick:Group by microservice, stream by instance [OK]
Common Mistakes:
MISTAKES
Mixing microservices in one log group
Using one stream for all logs causing confusion
Creating groups per instance instead of per service
Master "CloudWatch" in AWS
9 interactive learning modes - each teaches the same concept differently