This directory contains examples showing how to use claude_telemetry with different
backends and configurations.
- logfire_example.py - Using with Logfire for enhanced LLM telemetry
- otel_example.py - Using with generic OTEL backend
- honeycomb_example.py - Using with Honeycomb specifically
- interactive_example.py - Interactive conversation mode
All examples require:
export ANTHROPIC_API_KEY="your-api-key"For Logfire example:
export LOGFIRE_TOKEN="your-logfire-token"For Honeycomb example:
export HONEYCOMB_API_KEY="your-honeycomb-api-key"# Install the package first
pip install claude_telemetry
# Or install from source
pip install -e .
# Run any example
python examples/logfire_example.py
python examples/otel_example.py
python examples/honeycomb_example.py
python examples/interactive_example.pyEach example will:
- Configure telemetry (either Logfire or custom OTEL backend)
- Run a Claude agent with a specific task
- Capture all telemetry (prompts, tool calls, tokens, costs)
- Send telemetry to your configured backend
- Show console output of the agent's work
After running, check your observability backend to see:
- Full trace of the agent execution
- Token usage and costs
- Tool calls with inputs/outputs
- Timing information
- Any errors or issues
Feel free to modify these examples to:
- Change the prompts and tasks
- Enable/disable MCP servers
- Add different tools
- Configure different OTEL backends
- Adjust system prompts
The examples are meant to be starting points for your own use cases! 🚀