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
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
Human-readable agent name. If not provided, generates a name like
agent_abc123.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
Agent name. If not provided, uses the function name.
Examples
Basic UsageComplete Example: Multi-Agent System
Instruments Enum
Available instrumentation providers:Automatically trace OpenAI API calls (chat, completions, embeddings, etc.)
Automatically trace Anthropic API calls (Claude models)
Automatically trace Google Gemini API calls