-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ref(server-utils): Remove addVercelAiProcessors and Vercel AI OTel span processing
#23384
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
Draft
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
61a19c0
ref(server-utils): Remove `addVercelAiProcessors` and Vercel AI OTel …
mydea 8cee2f7
add docs and remove export
mydea 1f675b9
remove genai options, no longer needed
mydea 21aae9e
better migration doc entry
mydea 4fae669
fix(nextjs): Add edge no-op shim for `vercelAIIntegration`
mydea c201340
vite test for cloudflare
mydea 0b8a721
do not add integration directly, via vite only
mydea c17823e
remove overwritten thing
mydea 759c200
cleanup
mydea 571ff88
still add vercelAi for now
mydea f4fb222
export orchestrion vercel ai integration?
mydea cd952c4
do not export vercel ai in cloudflare SKD?
mydea 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
7 changes: 7 additions & 0 deletions
7
dev-packages/cloudflare-integration-tests/suites/tracing/vercelai/v6/vite.config.mts
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { cloudflare } from '@cloudflare/vite-plugin'; | ||
| import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite'; | ||
| import { defineConfig } from 'vite'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [cloudflare(), sentryCloudflareVitePlugin()], | ||
| }); |
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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,50 +1 @@ | ||
| /** | ||
| * This is a copy of the Vercel AI integration from the cloudflare SDK. | ||
| */ | ||
|
|
||
| import type { IntegrationFn } from '@sentry/core'; | ||
| import { defineIntegration, extendIntegration } from '@sentry/core'; | ||
| import { | ||
| addVercelAiProcessors, | ||
| vercelAIIntegration as serverUtilsVercelAiIntegration, | ||
| type VercelAiOptions, | ||
| } from '@sentry/server-utils'; | ||
|
|
||
| const _vercelAIIntegration = ((options: VercelAiOptions = {}) => { | ||
| const inner = serverUtilsVercelAiIntegration(options); | ||
|
|
||
| return extendIntegration(inner, { | ||
| options, | ||
| setup(client) { | ||
| addVercelAiProcessors(client); | ||
| }, | ||
| }); | ||
| }) satisfies IntegrationFn; | ||
|
|
||
| /** | ||
| * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library. | ||
| * This integration is not enabled by default, you need to manually add it. | ||
| * | ||
| * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). | ||
| * | ||
| * You need to enable collecting spans for a specific call by setting | ||
| * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call. | ||
| * | ||
| * ```javascript | ||
| * const result = await generateText({ | ||
| * model: openai('gpt-4-turbo'), | ||
| * experimental_telemetry: { isEnabled: true }, | ||
| * }); | ||
| * ``` | ||
| * | ||
| * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each | ||
| * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` | ||
| * to `true`. | ||
| * | ||
| * ```javascript | ||
| * const result = await generateText({ | ||
| * model: openai('gpt-4-turbo'), | ||
| * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true }, | ||
| * }); | ||
| */ | ||
| export const vercelAIIntegration = defineIntegration(_vercelAIIntegration); | ||
| export { vercelAIIntegration } from '@sentry/server-utils/orchestrion'; |
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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { defineIntegration } from '@sentry/core'; | ||
|
|
||
| /** | ||
| * Shim for the edge build so named imports from `@sentry/nextjs` stay resolvable in | ||
| * edge-compiled instrumentation modules. The real implementation ships in the server build; | ||
| * Vercel AI is not instrumented on the edge runtime. | ||
| */ | ||
| export const vercelAIIntegration = defineIntegration(() => { | ||
| return { | ||
| name: 'VercelAI', | ||
| }; | ||
| }); |
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 was deleted.
Oops, something went wrong.
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.