Request Tracing
Correlate client requests with Alfa API responses using the x-request-id header.
This API is currently in Preview.
Overview
Every request to the Alfa API can be tagged with an x-request-id header. Alfa echoes the same value back on the response, making it easy to correlate a client-side call with the corresponding Alfa request.
x-request-id is supported on all alfa-preview endpoints, excluding gRPC endpoints.
Behavior
The header value is returned on both successful responses and error responses, so you can capture it even when a request fails.
Recommended format
We recommend passing a UUID (v4 or v7) per logical client request. Values should be:
- Unique per request (do not reuse across retries if you want to distinguish attempts).
- Under 128 characters.
- Restricted to ASCII letters, digits, hyphens, and underscores.
Sending x-request-id
Streaming endpoints
x-request-id works the same way on HTTP streaming endpoints. For SSE, send the header on the initial request and read it from the response headers before the stream begins. For gRPC, it is currently ignored.
FAQ
Do I have to send x-request-id?
No. If you omit it, It will be omitted from the response.
Should I reuse the same x-request-id across retries?
That is up to you. Reusing the same ID makes it easy to group retries together in logs; generating a new ID per attempt makes it easier to distinguish them. We recommend a new ID per attempt so you can differentiate the successful from failed requests.
