ST01 Ghost span, one of ten ways LLM telemetry goes wrong
LLM span missing after the stream closes early
The app made the call, and no finished span ever reaches a backend. The call is not there. Its cost, its latency and its error are all absent, and nothing says so. Streams that the app leaves early or that fail mid-way are the usual victims.
What causes it
The library ends its span when the stream sends its last chunk. When the app stops reading before that, with a break, a close or an exception, or when the connection fails mid-way, the code that ends the span does not run. A span that never ends is never exported, so the backend gets nothing for the call.
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.
- langfuse google-genai 3.6.1, langfuse 5.2.0, with openai 3.42.1
3 scenarios:openai/async-concurrent-streams,openai/async-stream-helper,openai/stream-helper - litellm google-genai 3.6.1, litellm 1.111.0, with anthropic 2.4.0, openai 3.42.1
6 scenarios:anthropic/async-stream-early-exit,anthropic/stream-early-exit,anthropic/stream-early-exit-with,openai/async-stream-early-exit,openai/stream-early-exit,openai/stream-early-exit-with - mlflow google-genai 3.6.1, mlflow-skinny 3.18.0, with openai 3.42.1
9 scenarios:gemini/async-stream,gemini/async-stream-dropped,gemini/async-stream-early-exit,gemini/stream,gemini/stream-cache-hit,gemini/stream-dropped,gemini/stream-early-exit,gemini/stream-thinking,openai/async-concurrent-streams - openlit google-genai 3.6.1, openlit 1.45.0, with anthropic 0.125.0, openai 2.54.0
25 scenarios:anthropic/async-stream-dropped,anthropic/async-stream-early-exit,anthropic/async-stream-error-event,anthropic/rate-limited,anthropic/stream-dropped,anthropic/stream-early-exit,anthropic/stream-early-exit-with,anthropic/stream-error-event,gemini/async-stream,gemini/async-stream-dropped,gemini/async-stream-early-exit,gemini/rate-limited,gemini/stream,gemini/stream-cache-hit,gemini/stream-dropped,gemini/stream-early-exit,gemini/stream-thinking,openai/async-stream-dropped,openai/async-stream-early-exit,openai/async-stream-helper,openai/responses-stream-missing-finish-abort,openai/stream-dropped,openai/stream-early-exit,openai/stream-early-exit-with,openai/stream-helper - openllmetry google-genai 3.6.1, opentelemetry-instrumentation-anthropic 0.62.4, opentelemetry-instrumentation-google-generativeai 0.62.4, opentelemetry-instrumentation-openai 0.62.4, with anthropic 2.4.0
9 scenarios:anthropic/async-stream-early-exit,anthropic/stream-dropped,anthropic/stream-early-exit,anthropic/stream-early-exit-with,anthropic/stream-error-event,gemini/async-stream-dropped,gemini/async-stream-early-exit,gemini/stream-dropped,gemini/stream-early-exit - sentry google-genai 3.6.1, sentry-sdk 2.74.0, with openai 3.42.1
6 scenarios:openai/async-stream-dropped,openai/async-stream-early-exit,openai/responses-stream-missing-finish-abort,openai/stream-dropped,openai/stream-early-exit,openai/stream-early-exit-with
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 ST01 Ghost span.
How to fix it
Upgrade to a release that ends the span when the stream is closed, fails or is left unread. Until your library has one, read each stream to its end where you can.
Fixed upstream in these releases:
- openinference-instrumentation-openai 0.1.66, fixed by @feiiiiii5
- openinference-instrumentation-anthropic 3.1.0, fixed by @satyadevai
Reported in public:
- openllmetry#4536, reported by armanunix
- openllmetry#4643, reported by chrikrah
- openinference#3790, fixed, reported by feiiiiii5
- openinference#3930, fixed, reported by armanunix
- openlit#1828, reported by chrikrah