SKS Video Diary
apisobservabilitydebuggingdistributed-systems

The thread that makes production debugging possible

A request ID connects one request across services and logs, while traces and correlation IDs reveal timing and longer workflows.

A request ID looks like forgettable header plumbing until production turns one second of traffic into thousands of interleaved log lines. Then that small identifier becomes the fastest route from a user report to the exact path their request took.

The header worth noticing
$ curl https://api.example.com/orders \
-H "X-Request-ID: req_7f3a91"
X-Request-ID
0.0s/0.0s

Give every request an identity

At the system boundary, accept a trustworthy incoming request ID or generate a fresh one. Attach it to the request context immediately so every log statement and downstream call can reuse it.

A request gets its ID
Client
API
req_7f3a91
0.0s/0.0s

Carry it through the whole path

The value matters because it stays stable. The API passes it to the order service, the order service passes it to payments, and every service records it in structured logs. Service names change; the request ID does not.

One ID across every service
API
req_7f3a91
Orders
req_7f3a91
Payments
req_7f3a91
Provider
req_7f3a91
0.0s/0.0s

Turn a log storm into one story

When payment fails, searching by time is noisy and searching by an error message may miss the earlier work. Filtering on the request ID gathers the relevant records from every service and puts the journey back in order.

Filter thousands of logs
req_7f3a91
api
cache
orders
worker
payments
db
queue
auth
API
Orders
Payments
0.0s/0.0s

Identity is not timing

A request ID groups related logs, but it does not describe the shape or duration of the work. Distributed tracing does: one trace ID ties the journey together, while spans measure individual operations such as the API handler, a database query, or a payment call.

Request IDs versus traces
request_id
trace_id
spans
API 240 ms
DB 48 ms
Payment 156 ms
0.0s/0.0s

If the request starts asynchronous work, a correlation ID can preserve the business relationship even after the original request ends. It is a broader link across jobs, events, retries, and workflows.

Map IDs at third-party boundaries

External providers may discard your header and return an identifier of their own. Record both IDs together at the boundary. Your request stays traceable internally, and the provider's ID gives their support team something concrete to investigate.

Keep both sides of the handoff
Your system
req_7f3a91
Provider
pay_82KD
req_7f3a91
pay_82KD
0.0s/0.0s

None of this requires microservices. A busy monolith still handles concurrent requests, background work, database queries, and provider calls. The request ID is simply the thread that keeps one journey visible through all of them.