Skip to main content
Records Anthropic SDK LLM calls with model, input and output, and token counts. If your framework calls the Anthropic SDK underneath, this extra traces those LLM calls without the framework’s own steps. Also verified: anthropic 1.8.0 with instrumentor 2.1.6. The extra no longer installs that older instrumentor. See supported frameworks for how verification works.

In code

Call tracing.init(), attach the framework instrumentor to the provider it returns, and wrap the work in tracing.turn() and tracing.agent().
1

Install

terminal
2

Add the code

app.py
3

Run

terminal
Needs BOTGAUGE_API_KEY, ANTHROPIC_API_KEY, ANTHROPIC_MODEL. Set ANTHROPIC_BASE_URL too if your LLM isn’t api.anthropic.com.

Zero-code

Leave your app unchanged and start it with botgauge instrument. The sample still wraps the work in tracing.turn() and tracing.agent() so spans carry session and agent ids.
1

Install

terminal
2

Add the code

app.py
3

Run

terminal
Needs BOTGAUGE_API_KEY, ANTHROPIC_API_KEY, ANTHROPIC_MODEL. Set ANTHROPIC_BASE_URL too if your LLM isn’t api.anthropic.com.

View Anthropic spans live

Watch your Anthropic messages with token counts appear in BotGauge.

Try BotGauge →
See versions not verified if you run a different version, capture and redaction to control exported content, and troubleshooting if spans are missing.