Skip to content

feat(core): Enable streamGenAiSpans by default#21732

Merged
andreiborza merged 1 commit into
developfrom
ab/stream-gen-ai-spans-by-default
Jun 24, 2026
Merged

feat(core): Enable streamGenAiSpans by default#21732
andreiborza merged 1 commit into
developfrom
ab/stream-gen-ai-spans-by-default

Conversation

@andreiborza

Copy link
Copy Markdown
Member

Flip the streamGenAiSpans default to opt-out. The SDK now extracts gen_ai spans from transactions and sends them as v2 envelope items unless streamGenAiSpans: false is set. As when the option was explicitly enabled, this disables gen_ai message truncation by default; set enableTruncation: true on the respective AI integration to opt back in.

Self-hosted Sentry users should set streamGenAiSpans: false, since streamed gen_ai spans may not be ingested by their instance.

@andreiborza andreiborza requested a review from a team as a code owner June 24, 2026 10:46
@andreiborza andreiborza requested review from JPeer264 and mydea and removed request for a team June 24, 2026 10:46
Flip the `streamGenAiSpans` default to opt-out. The SDK now extracts
gen_ai spans from transactions and sends them as v2 envelope items
unless `streamGenAiSpans: false` is set. As before, streaming also
disables gen_ai message truncation by default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@andreiborza andreiborza force-pushed the ab/stream-gen-ai-spans-by-default branch from d1684dd to 9d7aa86 Compare June 24, 2026 10:46
@andreiborza andreiborza requested review from nicohrubec and removed request for JPeer264 June 24, 2026 11:06

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

are we worried that this no completely shuts off truncation including image redaction? what we could do is already basically do the work to build two separate paths for image and text truncation and then with v11 we could cleanly rip out the text truncation part without having to do the separation then. then we could also use the image truncation for the streamGenAiSpans part (but we can also follow up on this)

Comment thread CHANGELOG.md

### Important Changes

- **feat(core): Enable `streamGenAiSpans` by default ([#21732](https://github.com/getsentry/sentry-javascript/pull/21732))**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we even call this out? or maybe shorten this to basically only call out the bit about truncation? because that's the only actionable part for users

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's also actionable to know what this does so they can make a decision to turn it off instead of having to go find what this flag even is.

@andreiborza

Copy link
Copy Markdown
Member Author

No we are not worried about media truncation being off by default. We will document ways to redact media in beforeSendSpan until we rework truncation later on.

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice

@andreiborza andreiborza merged commit 12f7219 into develop Jun 24, 2026
284 checks passed
@andreiborza andreiborza deleted the ab/stream-gen-ai-spans-by-default branch June 24, 2026 11:31
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.

2 participants