Google Cloud Professional Cloud Developer — Question 273
You are monitoring a web application that is written in Go and deployed in Google Kubernetes Engine. You notice an increase in CPU and memory utilization. You need to determine which function is consuming the most CPU and memory resources. What should you do?
Answer options
- A. Add print commands to the application source code to log when each function is called, and redeploy the application.
- B. Create a Cloud Logging query that gathers the web application s logs. Write a Python script that calculates the difference between the timestamps from the beginning and the end of the application's longest functions to identify time-intensive functions.
- C. Import OpenTelemetry and Trace export packages into your application, and create the trace provider. Review the latency data for your application on the Trace overview page, and identify which functions cause the most latency.
- D. Import the Cloud Profiler package into your application, and initialize the Profiler agent. Review the generated flame graph in the Google Cloud console to identify time-intensive functions.
Correct answer: D
Explanation
The correct answer is D because using Cloud Profiler allows you to analyze and visualize CPU and memory usage in your application, making it easier to identify resource-intensive functions. Options A and B involve manual logging and scripting, which are less efficient and not suited for identifying resource usage directly. Option C focuses on latency rather than resource consumption, which does not address the original question regarding CPU and memory utilization.