Distributed Tracing
A trace records one request through your agent: every retrieval, tool call and LLM generation as a nested observation with start and end time, input, output, usage, cost and level. Traces are the base for every latency, error and cost view in ANTS Platform.
View traces under Discover AI → Tracing and grouped conversations under Discover AI → Sessions. For setup in each language see Python SDK, JS/TS SDK and Java SDK.
Creating traces
With the Python SDK, nested context managers become nested observations. Errors raised inside a context manager are recorded on that observation.
To mark a handled failure, set the level and a status message on the observation:
Traffic sent through Budget AI is traced automatically, with routing details for each attempt. OpenTelemetry spans can be sent to the platform's OTLP endpoint. See Sending Data In.
Reading a trace
Open a trace in Discover AI → Tracing to see:
- The tree of observations with the duration of each step, so the slowest step stands out.
- Input, output, metadata, model, usage and cost for each generation.
- Level and status message for each observation. Filter the trace list by Level to find traces that contain errors.
- A graph view of the agent's steps. See Trace Graphs.
Traces can also be fetched with the public API, GET /api/public/traces/{traceId}. See the API Reference.
Next steps
- Metrics & Monitoring: latency percentiles and error views built from traces.
- Traces: the full guide to the Tracing view.