Overview
Composo’s tracing module provides automatic instrumentation for LLM calls and manual tracking for multi-agent systems. Capture detailed interaction data to evaluate agent performance and debug complex workflows.ComposoTracer
Initialize automatic instrumentation for LLM provider APIs.init()
Configure tracing for one or more LLM providers.Parameters
Instruments | list[Instruments]
Single instrument or list of instruments to enable tracing for.Available Instruments:
Instruments.OPENAI: Trace OpenAI API callsInstruments.ANTHROPIC: Trace Anthropic API callsInstruments.GOOGLE_GENAI: Trace Google Gemini API calls
None, initializes tracing without provider-specific instrumentation.Examples
Single ProviderAgentTracer
Context manager for tracking agent interactions and organizing traces by agent.Constructor
Parameters
string
Human-readable agent name. If not provided, generates a name like
agent_abc123.string
Unique identifier for the agent. If not provided, generates a UUID.
Usage as Context Manager
Nested Agents
Track hierarchical agent systems with parent-child relationships:@agent_tracer Decorator
Decorator for automatically tracing agent functions.Parameters
string
Agent name. If not provided, uses the function name.
Examples
Basic UsageComplete Example: Multi-Agent System
Instruments Enum
Available instrumentation providers:enum
Automatically trace OpenAI API calls (chat, completions, embeddings, etc.)
enum
Automatically trace Anthropic API calls (Claude models)
enum
Automatically trace Google Gemini API calls