nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #238

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 source code is co

The correct answer is B. Import the Cloud Profiler package into your application, and initialize the Profiler agent. Review. Cloud Profiler is the purpose-built Google Cloud tool for identifying CPU and memory consumption at the source code level. By importing the Cloud Profiler package into the Go application and initializing the agent, the profiler continuously collects CPU and memory profiles during

Troubleshooting and Debugging Applications

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 source code is consuming the most CPU and memory resources. What should you do?

Options

  • ADownload, install, and start the Snapshot Debugger agent in your VM. Take debug snapshots of
  • BImport the Cloud Profiler package into your application, and initialize the Profiler agent. Review
  • CImport OpenTelemetry and Trace export packages into your application, and create the trace
  • DCreate a Cloud Logging query that gathers the web application's logs. Write a Python script that

How the community answered

(43 responses)
  • A
    5% (2)
  • B
    81% (35)
  • C
    2% (1)
  • D
    12% (5)

Explanation

Cloud Profiler is the purpose-built Google Cloud tool for identifying CPU and memory consumption at the source code level. By importing the Cloud Profiler package into the Go application and initializing the agent, the profiler continuously collects CPU and memory profiles during production workloads and surfaces which functions and lines of code are consuming the most resources. Option A (Snapshot Debugger) captures application state at a point in time for debugging logic errors, not performance profiling. Option C (OpenTelemetry/Trace) is for distributed tracing of requests across services, not source-level resource profiling. Option D (Cloud Logging + Python script) would only analyze log output and cannot identify which code paths consume the most CPU or memory.

Topics

#Cloud Profiler#Performance Monitoring#Resource Optimization#Go Applications

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice