Tracing
Follow one request, or a whole agent run, through Spro with trace IDs and resolved-model headers.
What is Tracing?
Tracing in an AI gateway links related requests with a trace ID, so one call or a multi-step agent run can be followed in one place. On Spro each request gets a trace ID from a header, from the request body, or generated by Spro. Every response also reports what was actually served, so you can check the resolved model and any fallback.
An agent run can call a model many times. Without a shared identifier, each call looks unrelated in your logs. Tracing groups them, so you can see the full path, including retries and fallbacks.
Trace IDs are chosen in this order: the x-spro-trace-id or x-trace-id header, then metadata.trace_id in the body, then an ID Spro generates. Every response reports the resolved model and any fallback.
Key features
What this feature does for your requests.
- Trace ID from a header, the request body, or generated
- Optional trace name for readable grouping
- All steps of an agent run grouped together
- Response headers show the resolved model, cache result and attempts
How it works
4 steps, from setup to the first request.
- 01
Pick a trace ID
Use a unique ID for each run.
- 02
Send it with each step
Add the same trace ID to every request in the run.
- 03
Open the traces page
See the run grouped with its requests.
- 04
Check the headers
Read x-spro-resolved-model and x-spro-fallback-from for each step.
Is it the right fit?
Specific situations where this feature helps, and where it does not.
Good fit if
- An agent makes several model calls for one task and you need the full path
- You are debugging retries and fallbacks inside one run
- You want AI steps linked to your own request IDs
Not a good fit if
- Single, independent calls where the request log is enough
- You need stored prompt content for audit. Traces carry metadata, so check data-handling settings
- Your code cannot send a shared trace ID, so runs would not group
Tracing FAQs
Common questions about Tracing.
Route every AI request through SPRO.
One OpenAI-compatible API for 350+ models, with intelligent routing, 29 built-in guardrails, observability, and automatic failover.
