traceId: what it is and how to find a request in the logs
A traceId is a shared number for all records of one request across all services. With it you find in the logs, within a minute, what happened between request and response.
What a traceId is
When a request passes through several services, each writes its own logs. A traceId is created at the entry point, the gateway or first service, and passed on in headers, so all records of one operation share the same number. The W3C Trace Context standard carries it in the traceparent header: a version, the 32-hex-character traceId, a 16-character span id and flags. Other headers exist too: X-B3-TraceId in Zipkin, X-Request-ID and X-Correlation-ID in in-house systems.
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01Where to get it
Check the response headers: many services return a traceId or X-Request-ID. It often appears in an error body. If the service does not return it, ask the developers to add it: a small change that saves hours of investigation. Some systems accept an X-Request-ID from the client, so you can set the number yourself.
How to search in Kibana
Open Discover, choose a time range around the request and enter a KQL query on the identifier field. In the Elastic Common Schema it is trace.id; elsewhere it may be traceId or trace_id. The result is every record of the operation across all services, in order.
trace.id : "4bf92f3577b34da6a3ce929d0e0e4736"Why a tester needs it
A 200 does not mean everything went right: the logs may show retries, failed background steps or wrong amounts. Checkcraft takes the traceId from the response, finds the records in Kibana itself and checks them with the same rules as the API response, all in one report.
Repeat this on your own API
Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.
Download FreeDownload and first runNo sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.
References
Start with the linked example and compare its result with your own test requirement.