PROFESSIONAL-CLOUD-DEVELOPER · Question #295
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…
The correct answer is D. Import the Cloud Profiler package into your application, and initialize the Profiler agent. Review. Cloud Profiler is GCP's continuous profiling service purpose-built for identifying which functions consume the most CPU and memory. For Go applications, you import the cloud.google.com/go/profiler package and call profiler.Start() during initialization. Cloud Profiler then…
Question
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?
Options
- AAdd print commands to the application source code to log when each function is called, and
- BCreate a Cloud Logging query that gathers the web application s logs. Write a Python script that
- CImport OpenTelemetry and Trace export packages into your application, and create the trace
- DImport the Cloud Profiler package into your application, and initialize the Profiler agent. Review
How the community answered
(40 responses)- A3% (1)
- B5% (2)
- C3% (1)
- D90% (36)
Explanation
Cloud Profiler is GCP's continuous profiling service purpose-built for identifying which functions consume the most CPU and memory. For Go applications, you import the cloud.google.com/go/profiler package and call profiler.Start() during initialization. Cloud Profiler then continuously samples the application's call stack and presents flame graphs in the console, directly showing function-level CPU and memory usage over time. Option C (OpenTelemetry traces) captures latency and request flow across services but does not provide CPU/memory profiling at the function level. Options A and B rely on logs, which require manual instrumentation of every function and cannot measure CPU cycles or heap allocations with the precision a profiler provides.
Topics
Community Discussion
No community discussion yet for this question.