GCP Professional Cloud Architect Practice Question
A retail company runs a microservices-based checkout application on Google Kubernetes Engine. Customers report occasional spikes in checkout latency, but no obvious errors appear in Cloud Logging. You already see high-latency requests in Cloud Trace. For rapid root-cause analysis, you want engineers to open any slow trace span in the Cloud Trace UI and immediately filter Cloud Logging to show only the log entries that were written during that same request. What should you do?
Ensure each microservice writes structured logs that include the Cloud Trace ID in the "logging.googleapis.com/trace" field so that Cloud Logging can automatically associate log entries with their originating traces.
Install Cloud Profiler agents on all services so that profiler snapshots are embedded in Cloud Trace spans and can be cross-referenced with logs.
Enable Data Access audit logs for GKE resources so Cloud Trace will automatically attach the relevant audit log entries to each span.
Export both Cloud Trace and Cloud Logging data to BigQuery and join the datasets on timestamp to find logs that correspond to slow traces.
To enable one-click navigation between traces and logs, each log entry must include the fully qualified trace resource name in the structured logging field "logging.googleapis.com/trace". When you use Google Cloud client libraries (or explicitly add this field yourself), the libraries read the trace context from the incoming "X-Cloud-Trace-Context" header and write the trace name into every log entry. Cloud Logging then automatically links each log entry to its originating trace and span, so selecting a span in Cloud Trace immediately filters logs to the same request. Exporting data to BigQuery, turning on GKE Data Access audit logs, or deploying Cloud Profiler will not establish this automatic, per-request correlation within the Cloud console.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is structured logging and why is it important in this scenario?
Open an interactive chat with Bash
What is the 'X-Cloud-Trace-Context' header and how does it work?
Open an interactive chat with Bash
How does Cloud Logging integrate with Cloud Trace for automatic correlation?
Open an interactive chat with Bash
What is the 'logging.googleapis.com/trace' field?
Open an interactive chat with Bash
What is the 'X-Cloud-Trace-Context' header and how is it used?
Open an interactive chat with Bash
How does Cloud Logging link logs to traces in Cloud Trace?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Analyzing and optimizing technical and business processes
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .