ST02 Double span, one of ten ways LLM telemetry goes wrong
Claude calls show twice their cost in the dashboard
One call reports its token usage on two spans. A backend that sums token attributes across spans counts the call twice. The Anthropic SDK traces itself since 1.14.0, so a library on top causes this unless it handles the SDK's span, as OpenInference does since openinference-instrumentation-anthropic 3.1.1.
What causes it
Two spans carry the token usage of one call. Since anthropic 1.14.0, the Anthropic Python SDK writes its own span for each call when a tracer provider is registered, and an instrumentation library on top writes a second one. A backend that sums usage across spans counts the call twice. Your invoice does not change.
Which versions show it
In the run of November 27, 2026, at the pinned versions, with spantruth 0.6.0. Each scenario links to its finding, with the exported spans and the command that reproduces it. The latest releases can differ.
- mlflow google-genai 3.6.1, mlflow-skinny 3.18.0
4 scenarios:gemini/async-basic,gemini/basic,gemini/cache-hit,gemini/thinking - otel-official-sdk-on google-genai 3.6.1, opentelemetry-instrumentation-genai-anthropic 1.3b0, with anthropic 2.4.0
23 scenarios:anthropic/agent-loop,anthropic/async-basic,anthropic/async-concurrent-streams,anthropic/async-stream,anthropic/async-stream-early-exit,anthropic/basic,anthropic/cache-1h,anthropic/cache-hit,anthropic/content-off,anthropic/content-on,anthropic/retry-429,anthropic/stream,anthropic/stream-cache-1h,anthropic/stream-cache-cumulative,anthropic/stream-cache-hit,anthropic/stream-content-off,anthropic/stream-content-on,anthropic/stream-early-exit,anthropic/stream-early-exit-with,anthropic/stream-thinking,anthropic/stream-tool-call,anthropic/thinking,anthropic/tool-call
How to check your project
Run this in your project's directory:
uvx spantruth doctor
It reads your lock file, or your requirements if you have no lock file, and tests the libraries it recognizes, at your versions, against a local fake provider. It needs no API key and does not run your code. The first run downloads those library versions into environments of its own. A finding of this kind is named ST02 Double span.
How to fix it
Let one span per call report usage. Set ANTHROPIC_OPEN_TELEMETRY=false before the client is created, or pass open_telemetry=False to the client. openinference-instrumentation-anthropic 3.1.1 and later turn the SDK's span off for the calls they trace.
Fixed upstream in these releases:
The long version, with measurements: the write-up.
Reported in public:
- langfuse#18978: dashboards show about 2x, reported by rvndbalaji
- opentelemetry-python-genai#971, reported by lmolkova
- openinference#4119, fixed, reported by PabloPardoGarcia