PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 7 of 25

[Optimizing service performance] You support a Node.js application running on Google Kubernetes Engine (GKE) in production. The application makes several HTTP requests to dependent applications. You want to anticipate which dependent applications might cause performance issues. What should you do?

Full set: 205 questions
Answer options
A: Instrument all applications with Stackdriver Profiler.
B: Instrument all applications with Stackdriver Trace and review inter-service HTTP requests. Correct answer
C: Use Stackdriver Debugger to review the execution of logic within each application to instrument all applications.
D: Modify the Node.js application to log HTTP request and response times to dependent applications. Use Stackdriver Logging to find dependent applications that are performing poorly.
Correct Answer:
B. Instrument all applications with Stackdriver Trace and review inter-service HTTP requests.
Explanation

Cloud Trace is the purpose-built Google Cloud service for distributed tracing. It captures latency data for requests as they travel across multiple services in a distributed system, such as a Node.js application on GKE calling dependent applications. By visualizing the request flow in a "waterfall" graph, Cloud Trace makes it easy to identify which specific inter-service HTTP call is introducing latency, directly addressing the need to anticipate which dependent applications might cause performance issues.

Why Incorrect

A. Cloud Profiler analyzes CPU and memory usage within a single service to find inefficient code, not latency between services.
C. Cloud Debugger is for inspecting an application's state at a specific line of code; it is not a performance analysis tool for inter-service communication.
D. Manually logging times adds code overhead and requires significant effort to query and analyze, whereas Cloud Trace automates this process efficiently.

References

1. Google Cloud Documentation, "Cloud Trace overview". The documentation states, "Cloud Trace is a distributed tracing system that collects latency data from your applications and displays it in the Google Cloud console... It lets you find performance bottlenecks in your applications."

2. Google Cloud Documentation, "Choosing a debugging and analysis tool". This page compares Trace, Debugger, Profiler, and Logging, clarifying that Trace is used to "Understand how requests propagate through your application and to observe latency."

Scroll to Top