You want to analyze latency in a microservices app using Cloud Trace. Which approach best helps identify the slowest service?
hard📝 Best Practice Q15 of 15
GCP - Cloud Monitoring and Logging
You want to analyze latency in a microservices app using Cloud Trace. Which approach best helps identify the slowest service?
AUse trace spans to compare latency times across services
BEnable Cloud Trace only on the frontend service
CCollect logs instead of traces for latency
DUse Cloud Trace only during off-peak hours
Step-by-Step Solution
Solution:
Step 1: Understand trace spans in microservices
Trace spans represent operations in each service, showing latency per service.
Step 2: Compare latency across services
By comparing spans, you can find which service takes the longest time.
Step 3: Evaluate other options
Enable Cloud Trace only on the frontend service limits data to frontend only, missing backend. Collect logs instead of traces for latency is about logs, not latency. Use Cloud Trace only during off-peak hours restricts data collection unnecessarily.
Final Answer:
Use trace spans to compare latency times across services -> Option A
Quick Check:
Trace spans reveal slow services [OK]
Quick Trick:Compare spans latency to find slow service [OK]
Common Mistakes:
Enabling trace on only one service
Confusing logs with trace latency data
Limiting trace collection to certain hours
Master "Cloud Monitoring and Logging" in GCP
9 interactive learning modes - each teaches the same concept differently