Skip to main content
Advanced patterns for complex workflows.

Multi-Span Tracing

Track complex workflows with hierarchical spans. Any trace or trace_llm call made inside a parent trace callback automatically becomes a child span:

Multi-Span with Async

The same pattern works fully in async contexts:

Span Attributes

Add custom attributes to enrich any span:

Graceful Shutdown

Flush all buffered spans before your process exits:
For scripts, call flush() at the end:

Next Steps

API Reference

Complete API documentation

Multi-Span Guide

Detailed multi-span tracing guide