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?
A. Create a Stackdriver Debugger Logpoint with the variable at a specific line location in your application’s source code, and view the value in the Logs Viewer.
B. Use your local development environment and code editor to set up a breakpoint in the source code, run the application locally, and then inspect the value of the variable.
C. Modify the source code of the application to log the value of the variable, deploy to the development environment, and then run the application to capture the value in Stackdriver Logging.
D. Create a Stackdriver Debugger snapshot at a specific line location in your application’s source code, and view the value of the variable in the Google Cloud Platform Console.
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
D
Explanation
A. Create a Stackdriver Debugger Logpoint with the variable at a specific line location in your application’s source code, and view the value in the Logs Viewer.
(Viewing the logs in the Log Viewer, not within Stackdriver/Operations UI.)
B. Use your local development environment and code editor to set up a breakpoint in the source code, run the application locally, and then inspect the value of the variable.
(We need to inspect the variable in prod, not in our local dev environment.)
C. Modify the source code of the application to log the value of the variable, deploy to the development environment, and then run the application to capture the value in Stackdriver Logging.
(Variable values in the dev environment will not be the same as running in prod.)
D. Create a Stackdriver Debugger snapshot at a specific line location in your application’s source code, and view the value of the variable in the Google Cloud Platform Console.
(Debug info shows value of a specific variable as required. The information is available within the Stackdriver/Operations UI.)