Manual Tracing
Use the@trace decorator to automatically track any function execution as a span. This captures arguments, return values, and execution time.
User & Session Context
Context allows you to associate traces with specific users or sessions, enabling you to debug issues per-user or view session-based analytics.Global Context
You can set context globally, which will apply to all subsequent operations until changed.Scoped Context
For multi-threaded or async applications where you handle multiple requests simultaneously, use thecontext manager to scope data to a specific block.
How It Works
- OpenTelemetry: We use OTel under the hood for maximum compatibility.
- Spans: Every action (function call, LLM request) is recorded as a Span.
- Transport: Data is batched and sent asynchronously to the AgentBasis backend, ensuring minimal impact on your application’s latency.
