GCP Professional Cloud Architect Practice Question
Your company runs a latency-sensitive Java microservice on Google Kubernetes Engine (GKE). In production, a specific request occasionally returns a 500 error whose stack trace cannot be reproduced in staging. You need to capture the exact line of code and the values of local variables only when the error occurs, without pausing the container or increasing latency for other users. Which Google Cloud approach best meets these requirements?
Enable Cloud Trace sampling at 100 percent and examine the detailed spans for requests that return HTTP 500 to view variable contents.
Instrument additional log statements around the suspected code path, rebuild the container image, redeploy the workload, and inspect Cloud Logging for the next failure.
Create a conditional snapshot with Cloud Debugger on the suspected line in the service code; retrieve the captured variable state when the 500 error is triggered.
Run Cloud Profiler in heap and CPU modes to capture profiles during peak load and analyze them for the faulty variable values when errors occur.
Cloud Debugger lets you set a non-intrusive snapshot at a line of code with an optional condition such as "responseStatus == 500". When that condition is met in any running pod, the debugger takes a snapshot that includes the stack trace and in-scope variable values. Execution is not stopped; the snapshot is taken asynchronously with negligible performance overhead (typically <1 ms). Cloud Trace and Cloud Profiler provide performance data but cannot inspect application variables, while adding logging and redeploying requires code changes and may miss intermittent issues.
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 Cloud Debugger and how does it work?
Open an interactive chat with Bash
How is Cloud Debugger different from Cloud Trace?
Open an interactive chat with Bash
What are some best practices when using Cloud Debugger?
Open an interactive chat with Bash
What is Cloud Debugger and how does it work?
Open an interactive chat with Bash
How is Cloud Debugger different from tools like Cloud Trace or Cloud Profiler?
Open an interactive chat with Bash
What is the advantage of conditional snapshots in Cloud Debugger?
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .