Identifying Delay in Downstream Services - PCDE Exam Preparation |

How to Identify Delay in Downstream Services

Question

You have an application running in Google Kubernetes Engine.

The application invokes multiple services per request but responds too slowly.

You need to identify which downstream service or services are causing the delay.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

https://medium.com/google-cloud/monitoring-your-dataflow-pipelines-80b9a2849f7a

To identify which downstream service or services are causing the delay in an application running in Google Kubernetes Engine (GKE), the best approach is to use a distributed tracing framework such as OpenTelemetry or Stackdriver Trace.

Distributed tracing provides a way to trace requests as they flow through multiple services in a microservices architecture. By using a tracing framework, you can identify which service is causing the delay and where the bottleneck is occurring.

OpenTelemetry and Stackdriver Trace are two popular distributed tracing frameworks that provide a way to trace requests across services running in GKE. Both frameworks use a tracing API that allows developers to instrument their code and trace requests across services.

To use a distributed tracing framework, you need to instrument your application code with tracing statements that create spans, which represent the lifecycle of a request. Each span contains metadata such as the service name, start and end time, and any errors or annotations.

Once the application code is instrumented, you can use the tracing framework to collect and aggregate the spans across services. This allows you to see the entire lifecycle of a request and identify which service is causing the delay.

In addition to using a distributed tracing framework, you can also investigate the Liveness and Readiness probes for each service. These probes provide a way to check the health of a service and ensure that it is ready to receive traffic. If a service is not responding to the probes, it may be causing a delay in the request.

Finally, you can analyze VPC flow logs along the path of the request. VPC flow logs provide a way to capture network traffic and analyze it for performance issues. By analyzing the logs, you can identify any network bottlenecks that may be causing the delay.

In summary, to identify which downstream service or services are causing the delay in an application running in GKE, you should use a distributed tracing framework such as OpenTelemetry or Stackdriver Trace. Additionally, you can investigate the Liveness and Readiness probes for each service and analyze VPC flow logs along the path of the request.