Skip to content

feat(core)!: Remove streamGenAiSpans flag - #22495

Merged
nicohrubec merged 2 commits into
developfrom
feat/remove-stream-gen-ai-spans-flag
Jul 29, 2026
Merged

feat(core)!: Remove streamGenAiSpans flag#22495
nicohrubec merged 2 commits into
developfrom
feat/remove-stream-gen-ai-spans-flag

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Jul 22, 2026

Copy link
Copy Markdown
Member

Removes the streamGenAiSpans client option, making the extraction of gen_ai spans into a v2 span envelope container the unconditional default (it was already the default via @default true). Truncation logic will be removed in a follow up.

Related to #21129

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.83 kB -0.05% -14 B 🔽
@sentry/browser - with treeshaking flags 28.04 kB -0.04% -10 B 🔽
@sentry/browser (incl. Tracing) 47.11 kB -0.03% -11 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 47.12 kB -0.03% -10 B 🔽
@sentry/browser (incl. Tracing, Profiling) 51.82 kB -0.03% -11 B 🔽
@sentry/browser (incl. Tracing, Replay) 86.42 kB -0.02% -12 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.85 kB -0.02% -9 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 91.14 kB -0.02% -13 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 103.78 kB -0.02% -12 B 🔽
@sentry/browser (incl. Feedback) 47.14 kB -0.03% -13 B 🔽
@sentry/browser (incl. sendFeedback) 34.67 kB -0.05% -14 B 🔽
@sentry/browser (incl. FeedbackAsync) 39.77 kB -0.04% -13 B 🔽
@sentry/browser (incl. Metrics) 30.9 kB -0.04% -11 B 🔽
@sentry/browser (incl. Logs) 31.13 kB -0.04% -12 B 🔽
@sentry/browser (incl. Metrics & Logs) 31.81 kB -0.04% -10 B 🔽
@sentry/react 31.62 kB -0.04% -10 B 🔽
@sentry/react (incl. Tracing) 49.34 kB -0.03% -10 B 🔽
@sentry/vue 34.75 kB -0.04% -12 B 🔽
@sentry/vue (incl. Tracing) 49.06 kB -0.04% -15 B 🔽
@sentry/svelte 29.86 kB -0.05% -13 B 🔽
CDN Bundle 31.88 kB -0.04% -10 B 🔽
CDN Bundle (incl. Tracing) 47.45 kB -0.04% -15 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.43 kB -0.03% -9 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 48.83 kB -0.03% -11 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 72.79 kB -0.02% -8 B 🔽
CDN Bundle (incl. Tracing, Replay) 85.1 kB -0.02% -10 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.39 kB -0.02% -11 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 90.86 kB -0.02% -12 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.17 kB -0.02% -13 B 🔽
CDN Bundle - uncompressed 95.07 kB -0.04% -38 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 142.29 kB -0.03% -38 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.78 kB -0.04% -38 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.27 kB -0.03% -38 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.54 kB -0.02% -38 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.55 kB -0.02% -38 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.51 kB -0.02% -38 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.25 kB -0.02% -38 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.21 kB -0.02% -38 B 🔽
@sentry/nextjs (client) 51.93 kB -0.02% -10 B 🔽
@sentry/sveltekit (client) 47.52 kB -0.03% -12 B 🔽
@sentry/core/server 79.74 kB -0.06% -40 B 🔽
@sentry/core/browser 51.6 kB -0.03% -12 B 🔽
@sentry/node 121.02 kB -0.04% -40 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.47 kB -0.02% -12 B 🔽
@sentry/aws-serverless 92.69 kB -0.02% -10 B 🔽
@sentry/cloudflare (withSentry) - minified 197.7 kB -0.06% -103 B 🔽
@sentry/cloudflare (withSentry) 486 kB -0.04% -188 B 🔽

View base workflow run

Comment thread dev-packages/node-integration-tests/suites/tracing/langgraph/test.ts Outdated
@nicohrubec
nicohrubec force-pushed the feat/remove-stream-gen-ai-spans-flag branch 3 times, most recently from 3a1b409 to 29f97f5 Compare July 22, 2026 14:54
@nicohrubec
nicohrubec marked this pull request as ready for review July 23, 2026 07:34
@nicohrubec
nicohrubec requested a review from a team as a code owner July 23, 2026 07:34
@nicohrubec
nicohrubec requested review from JPeer264, andreiborza and isaacs and removed request for a team July 23, 2026 07:34
Removes the `streamGenAiSpans` client option. The behavior it gated
(extracting gen_ai spans from transactions into a v2 span envelope
container) was already the default and is now unconditional — there is
no longer a way to opt out.

For static transactions, `extractGenAiSpansFromEvent` always pulls
gen_ai spans into a v2 span container. For full span streaming
(`traceLifecycle: 'stream'`), the existing `hasSpanStreamingEnabled`
guard still short-circuits so spans are not extracted twice.

Because gen_ai spans now always take the v2 path (not subject to the
transaction payload-size limits that truncation works around),
`shouldEnableTruncation` simplifies to `!getClient()`. The
`enableTruncation` escape hatch is intentionally left in place for a
follow-up.

Test suites that set `streamGenAiSpans: false` to assert on
`transaction.spans` are migrated to assert on the v2 span container;
redundant `streamGenAiSpans: true` config lines are removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec force-pushed the feat/remove-stream-gen-ai-spans-flag branch from 29f97f5 to 428912c Compare July 29, 2026 08:09
Comment thread packages/core/src/types/options.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6252455. Configure here.

…flare-agent e2e app

The cloudflare-agent e2e app landed on develop after this branch was cut and
still set `streamGenAiSpans: false` to keep gen_ai spans embedded in the
transaction. With the flag gone, gen_ai spans always stream as a separate span
container, so the app dropped the option and the AI streaming test now asserts
on the streamed span (matched to the request via the transaction trace id).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec force-pushed the feat/remove-stream-gen-ai-spans-flag branch from 6252455 to ab3644f Compare July 29, 2026 08:46
@nicohrubec
nicohrubec merged commit d0f9d4c into develop Jul 29, 2026
271 checks passed
@nicohrubec
nicohrubec deleted the feat/remove-stream-gen-ai-spans-flag branch July 29, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants