World map

 

BM: Baca dalam Bahasa Melayu

World O4: The Diary & One Order

Follow one order across services

You will learn: how one trace ID travels between services, so you can follow one order end to end.

Checked with Prometheus 3 on 1 Nov 2026

The problem

Order A1041 failed. Its kedai-api spans are in one trace. Its kedai-pay spans sit in another trace, with a new trace ID. What went wrong?

Pick one answer.

Watch

kedai-api calls kedai-pay. Tap the line that carries the order number.

0 of 1 found

Passing the trace ID along, in a header, is context propagation: Passing the trace ID to the next service, in a traceparent header, so the order keeps its number..

Try it

Build the traceparent header. Tap the pieces in order.

Tap the pieces in the right order.

…

Predict

kedai-pay reads that header and starts its span POST /pay. What is its Parent ID?

Pick one answer.

Check

bash
logcli query --quiet '{app=~"kedai-.*"} |= "3c9a51e0b7d24f6e9a18c2d4e6f80b15"'
2026-11-01T17:45:22Z {app="kedai-api", detected_level="error", service_name="kedai-api"} {"level":"error","msg":"payment timeout","order_id":"A1041","duration_ms":3000,"trace_id":"3c9a51e0b7d24f6e9a18c2d4e6f80b15"}
2026-11-01T17:45:21Z {app="kedai-pay", detected_level="warn", service_name="kedai-pay"} {"level":"warn","msg":"slow query","table":"payments","duration_ms":2800,"trace_id":"3c9a51e0b7d24f6e9a18c2d4e6f80b15"}
2026-11-01T17:45:19Z {app="kedai-api", detected_level="info", service_name="kedai-api"} {"level":"info","msg":"order received","order_id":"A1041","trace_id":"3c9a51e0b7d24f6e9a18c2d4e6f80b15"}
logcli searches every kedai diary for the trace ID. Three lines come back: order received in kedai-api, a slow query of 2800 ms in kedai-pay, then payment timeout in kedai-api.

The same number sits in both diaries. One search finds the order everywhere.

Check

First thing that happened at the top. Put these in order. Use the arrows, or drag.

  • kedai-pay: slow query on payments, 2.8 s
  • kedai-api: payment timeout after 3 s
  • kedai-api: order received

Put order A1041’s story in time order. Use the times in the lines.

You did it!

You can now follow one order across services by its trace ID.

Go deeper (optional)

You rarely write traceparent by hand. OpenTelemetry’s instrumentation for HTTP clients and servers adds and reads it for you. Still check every hop. One service that drops the header splits the trace in two.