Group the records of the same request to find the slow segment
Trace context: the identifying information that carries the trace and span relationships between services.
Metrics show values and distributions over a period, logs show individual events, and traces show the operations within one request. A low CPU figure alone does not show that requests were fast, because the three kinds of data have different units of observation.
When the service that receives a request passes the trace context to the next service, the parent-child relationships between spans can be reconstructed. If propagation breaks, downstream work appears as a separate trace, and total latency may be split incorrectly. The service name and deployment revision identify which code produced each record.
In the training example, the gateway responded after 420 ms, while the runtime span is 90 ms. You cannot immediately conclude that the remaining 330 ms is network delay. First check queue waiting, serialization, missing spans, and clock differences.
Read the two example logs below and write down whether they belong to the same request and what evidence would break down the 330ms further. The commands are a reference for querying the same fields in an isolated environment; in the browser, you only read the output.
- Why does this happen?
- When the service that receives a request passes the trace context to the next service, the parent-child relationships between spans can be reconstructed. If propagation breaks, downstream work appears as a separate trace, and total latency may be split incorrectly. The service name and deployment revision identify which code produced each record.
- When is it a problem?
- If clocks disagree or context propagation is broken, there are insufficient grounds to proceed.
- Common beginner misconceptions
- Do not copy authentication tokens or raw user input into baggage or logs. Also validate trace context that arrives from outside at the trust boundary.
- How to verify it yourself
- First compare service.name, the revision, and the environment. Distinguish the trace ID, span ID, and parent span ID for the gateway and the runtime.