Available for: Python and TypeScript.
- Python
- TypeScript
Installation
Usage
RegisterZespanLlamaIndexCallbackHandler with LlamaIndex’s global callback manager.One trace per query or agent run, with the reply stored
A query or an agent run is one trace: the model calls, tool calls and agent steps below it share it and sit under the step that made them, with nowith_zespan_trace wrapper needed. Before, every event started a trace of its own. A call made inside your own with_zespan_trace joins that trace instead.- Replies are stored. A model span carries
prompt_textandcompletion_text(after your capture settings and redaction; with prompt storage turned off neither is sent), lists the tools it asked for, and an agent step shows the agent’s name when LlamaIndex gives one. Before, the text was sent under older names and was only kept by newer servers. - New instrumentation handlers (
ZespanSpanHandler,ZespanEventHandler) send trace and span ids too, so their spans group into one trace. An agent’s tool calls sit under the span that made them; the event handler finds the span handler built for the same client, or you can pass it (ZespanEventHandler(client, span_handler=...)). - Concurrent queries are separate traces, including several queries or agent runs in parallel on one shared handler (asyncio tasks or threads). A run that raised before it finished does not leak into the next one.

