Repository navigation
fix(core): Reparent spans started under an ignored child span - #26801
Merged
Merged
Conversation
Contributor
size-limit report 📦Compared: f02b78b (PR test merge using develop at 2f0cf3f) Against: 6f6ed97 (develop) · base run #68498 ✅ 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
|
Lms24
self-requested a review
November 24, 2026 11:00
RulaKhaled
marked this pull request as ready for review
November 25, 2026 18:22
Lms24
approved these changes
Nov 27, 2026
RulaKhaled
enabled auto-merge (squash)
November 30, 2026 18:41
…Span withActiveSpan made an ignored child span active, so every span started in the callback was dropped with it. Core now stores the ignored child's parent when it creates the span, and withActiveSpan and parentSpan resolve to that parent, as startSpan already does. Closes #25389 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…span Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l spans Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename getEmittedSpan to getSpanOrUnignoredParent, shorten the comments, and cover startSpan with an ignored child passed as parentSpan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RulaKhaled
force-pushed
the
fix/with-active-span-ignored-child
branch
from
December 1, 2026 20:39
5db62e4 to
1ec1776
Compare
52 tasks done
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
Spans whose parent is an ignored child span (
ignoreSpanswith span streaming) are no longer dropped. This covers spans started insidewithActiveSpan(ignoredSpan, ...)and spans passedparentSpan: ignoredSpaninstartSpan,startSpanManualandstartInactiveSpan. They are parented to the ignored span's parent, asstartSpanalready did for nested calls, and outgoing requests propagate that parent with-1instead of the ignored span's ID with-0.Why
The spec says children of an ignored child span must be reparented to its parent. Until now each integration had to guard for this itself. The tracing channel helper, Prisma and LangChain each checked
spanIsIgnored(span) && getRootSpan(span) !== spanbefore activating a span, and integrations without that check lost the whole subtree. Ignoringgen_ai.invoke_agentdropped every tool and HTTP span under Anthropic's tool runner. Ignoringgen_ai.execute_tooldropped the spans started inside a Flue tool and every pi-durable subagent run. This moves the rule into core and removes the three guards, so every integration gets it.Core stores the parent when it creates the ignored span instead of reading the active span later, because Flue and pi-durable resume spans from a background loop whose active span belongs to another request. Inside the callback,
getActiveSpan()now returns the parent. Ignored segments are unchanged and still drop their subtree. Trace headers built directly from an ignored span withgetTraceData({ span })still carry its ID with-0. That's a follow-up.Closes: #25389
🤖 Generated with Claude Code