Retrieve Trace For Run
client.runs.trace.retrieve(stringrunID, TraceRetrieveParams { limit } query?, RequestOptionsoptions?): TraceRetrieveResponse
/v1/runs/{run_id}/trace
Retrieve OTEL trace spans for a run.
Returns a filtered set of spans relevant for observability:
- agent_step: Individual agent reasoning steps
- tool executions: Tool call spans
- Root span: The top-level request span
- time_to_first_token: TTFT measurement span
Requires ClickHouse to be configured for trace storage.
Parameters
runID: string
Returns
TraceRetrieveResponse = Array<Record<string, unknown>>
Retrieve Trace For Run
import Letta from '@letta-ai/letta-client';
const client = new Letta({
apiKey: process.env['LETTA_API_KEY'], // This is the default and can be omitted
});
const traces = await client.runs.trace.retrieve('run_id');
console.log(traces);
[
{
"foo": "bar"
}
]
Returns Examples
[
{
"foo": "bar"
}
]