PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #151
You support a Python application running in production on Compute Engine. You want to debug some of the application code by inspecting the value of a specific variable. What should you do?
The correct answer is D. Create a Stackdriver Debugger snapshot at a specific line location in your application's source. Cloud Debugger (formerly Stackdriver Debugger) snapshots allow you to capture the full application state - including local variables, call stack, and object values - at a specific line of code in a live production application without pausing or redeploying it. This is exactly…
Question
Options
- ACreate a Stackdriver Debugger Logpoint with the variable at a specific line location in your
- BUse your local development environment and code editor to set up a breakpoint in the source
- CModify the source code of the application to log the value of the variable, deploy to the
- DCreate a Stackdriver Debugger snapshot at a specific line location in your application's source
How the community answered
(31 responses)- A6% (2)
- B3% (1)
- C6% (2)
- D84% (26)
Explanation
Cloud Debugger (formerly Stackdriver Debugger) snapshots allow you to capture the full application state - including local variables, call stack, and object values - at a specific line of code in a live production application without pausing or redeploying it. This is exactly what is needed to inspect a variable's value. A Logpoint (option A) only appends a log message and is less suited for deep state inspection. Option B (local breakpoint) cannot attach to a live Compute Engine instance. Option C requires a code change and redeployment, adding risk to production.
Topics
Community Discussion
No community discussion yet for this question.