Query Spans
POST/tracing/spans/query
deprecated
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
Query spans and traces in the tracing backend.
Use focus in the request body to control the response shape:
"trace"(default): returns a nestedtracestree keyed bytrace_idthen by span name. Children hang off their parent'sspansfield. Best for rendering a trace waterfall."span": returns a flatspanslist. Best for paginating or filtering across all spans regardless of hierarchy.
Use oldest / newest (unix seconds) to window the query and
limit to cap the number of traces/spans returned.
The response preserves the Agenta ag.* attribute namespace and
includes computed metrics (ag.metrics.duration, ag.metrics.tokens,
ag.metrics.costs) on each span. The traces tree returned here is
the same shape that POST /tracing/spans/ingest accepts as its
traces field.
Request
Responses
- 200
- 422
Successful Response
Validation Error