Skip to main content
The TraceRoot Python SDK provides automatic and manual instrumentation for AI agents using OpenTelemetry.

Instrumentation

The Observe Decorator

Wrap any function to create a span, works with sync functions, async functions, and generators.

Parameters

Setting Trace Context

Use using_attributes to set user and session context for all spans created within a block:

Parameters

Updating Spans and Traces

Update the current span or trace programmatically:

update_current_span Parameters

update_current_trace Parameters

Environment Variables

All parameters can be set via environment variables: