-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(core)!: Remove streamGenAiSpans flag
#22495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
+147
−261
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
26 changes: 18 additions & 8 deletions
26
dev-packages/e2e-tests/test-applications/cloudflare-vercelai-v7-als/tests/index.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,33 @@ | ||
| import { expect, test } from '@playwright/test'; | ||
| import { waitForTransaction } from '@sentry-internal/test-utils'; | ||
| import { getSpanOp, waitForRequest } from '@sentry-internal/test-utils'; | ||
|
|
||
| test('does not capture Vercel AI v7 spans without nodejs_compat', async ({ baseURL }) => { | ||
| const transactionPromise = waitForTransaction('cloudflare-vercelai-v7-als', txn => { | ||
| return txn.transaction === 'GET /generate'; | ||
| // The transaction envelope also carries any extracted gen_ai spans as a span v2 container item, | ||
| // so we wait for the whole envelope and assert neither place contains AI spans. | ||
| const envelopePromise = waitForRequest('cloudflare-vercelai-v7-als', ({ envelope }) => { | ||
| const transactionItem = envelope[1].find(([header]) => header.type === 'transaction'); | ||
| return (transactionItem?.[1] as any)?.transaction === 'GET /generate'; | ||
| }); | ||
|
|
||
| const response = await fetch(`${baseURL}/generate`); | ||
| expect(response.status).toBe(200); | ||
|
|
||
| const transaction = await transactionPromise; | ||
| const { envelope } = await envelopePromise; | ||
|
|
||
| const transaction = envelope[1].find(([header]) => header.type === 'transaction')?.[1] as any; | ||
| expect(transaction.transaction).toBe('GET /generate'); | ||
| expect(transaction.contexts?.trace?.op).toBe('http.server'); | ||
|
|
||
| // v7 uses diagnostics_channel which is not available with nodejs_als, | ||
| // so no AI spans should be present. | ||
| const aiSpans = (transaction.spans || []).filter( | ||
| // v7 uses diagnostics_channel which is not available with nodejs_als, so no AI spans should be | ||
| // present — neither embedded in the transaction nor streamed as a span v2 container item. | ||
| const embeddedAiSpans = (transaction.spans || []).filter( | ||
| (span: any) => span.op?.startsWith('gen_ai.') || span.description?.includes('generateText'), | ||
| ); | ||
| expect(aiSpans).toHaveLength(0); | ||
| expect(embeddedAiSpans).toHaveLength(0); | ||
|
|
||
| const streamedGenAiSpans = envelope[1] | ||
| .filter(([header]) => header.type === 'span') | ||
| .flatMap(([, payload]) => (payload as any).items ?? []) | ||
| .filter((span: any) => getSpanOp(span)?.startsWith('gen_ai.')); | ||
| expect(streamedGenAiSpans).toHaveLength(0); | ||
| }); |
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
63 changes: 23 additions & 40 deletions
63
dev-packages/e2e-tests/test-applications/cloudflare-vercelai-v7-compat/tests/index.test.ts
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,5 +11,4 @@ Sentry.init({ | |
| bufferSize: 1000, | ||
| }, | ||
| integrations: [Sentry.vercelAIIntegration()], | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,5 +21,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,5 +13,4 @@ Sentry.init({ | |
| enableTruncation: true, | ||
| }), | ||
| ], | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,5 +20,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,5 +14,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,5 +15,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,5 +14,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,5 +21,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,5 +13,4 @@ Sentry.init({ | |
| enableTruncation: true, | ||
| }), | ||
| ], | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,5 +20,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,5 +14,4 @@ Sentry.init({ | |
| } | ||
| return event; | ||
| }, | ||
| streamGenAiSpans: true, | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.