GKE-hosted Go web app shows increased CPU and memory. How do you identify which source code functions consume the most CPU and memory?
Choose an answer
Tap an option to check your answer.
Correct answer: 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..
Why this is the answer
Cloud Profiler is designed to identify resource consumption (CPU, memory, heap, contention, threads) in your application's code. By importing the Profiler package and initializing the agent, your Go application will send profiling data to Google Cloud. The generated flame graph in the Cloud Console visually represents the call stack and resource usage, making it easy to pinpoint functions consuming the most CPU and memory. Snapshot Debugger is for inspecting variables and call stacks at specific points in time, not for overall resource profiling. OpenTelemetry and Trace focus on latency and distributed tracing, showing bottlenecks between services or within request flows, but not directly identifying specific code functions consuming CPU/memory. Analyzing logs with a Python script is a manual and inefficient way to profile code and would not provide the detailed insights of a dedicated profiling tool.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed