Repository navigation
fix(server-utils): Record time to first chunk on the first output chunk - #27052
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
size-limit report 📦Compared: c623467 (PR test merge using develop at 8a234e4) Against: 8a234e4 (develop) · base run #68521 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 64 successful. See the run.
Successful checks
|
andreiborza
marked this pull request as ready for review
December 2, 2026 09:17
javascript-sdk-gitflow
Bot
requested review from
RulaKhaled,
isaacs and
timfish
December 2, 2026 09:18
andreiborza
requested review from
maxcell,
msonnb and
nicohrubec
and removed request for
RulaKhaled,
isaacs and
timfish
December 2, 2026 09:18
timfish
approved these changes
Dec 2, 2026
timfish
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Streamed AI spans now set
gen_ai.response.time_to_first_chunkon the first chunk that carries output (text, reasoning, refusals, tool calls), for all providers. Streams with no output no longer get the attribute.Why
Role, usage, and lifecycle events often arrive first, so the value was too low or set when the model produced nothing. This follows the attribute definition in sentry-conventions.
Sentry traces
Node.js, OpenAI streamed chat completion against a mock server that sends a role-only chunk at +30 ms and the first text at +280 ms.
Before,
time_to_first_chunkis 0.034 s (the role chunk).After,
time_to_first_chunkis 0.284 s (the first text).Closes: #27043