Tracing
trajectory lets you trace functions, tools, and LLM calls with minimal changes to your codebase.
Create a Tracer
tracer.py
Trace tools and functions
Use@tracer.observe(span_type="...") to trace any callable. Mark tools with span_type="tool" and business logic with span_type="function".
tools.py
Create spans and log data
You will automatically create spans and can view it on your dashboard in the ‘traces’ section. If you are using async contexts like FastAPI check out the section on it’s integration. The integration is slightly different.Examples
FastAPI Integration
Instrument a FastAPI chatbot with trajectory tracing.
LangGraph Integration
Trace LangGraph nodes and runs using JudgevalCallbackHandler.

