-
-
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
Changes from all commits
67f2a5c
1c5ac32
5e88562
deb0b3d
b45c204
a12a2e1
5582c1f
2723482
06b955a
a3f614e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| import type { Integration } from '@sentry/core'; | ||
| import { vercelAIIntegration } from './integrations/tracing/vercelai'; | ||
| import { getBaseDefaultIntegrations, initWithDefaultIntegrations } from './baseSdk'; | ||
| import type { CloudflareClient, CloudflareOptions } from './client'; | ||
| import { vercelAIIntegration } from '@sentry/server-utils/orchestrion'; | ||
|
|
||
| /** | ||
| * Get the default integrations for the Cloudflare SDK. | ||
| * | ||
| * This is the full set and requires the `nodejs_compat` compatibility flag. Runtimes that cannot | ||
| * enable it (e.g. Shopify Oxygen) go through `wrapRequestHandler`, which only sets up | ||
| * `getBaseDefaultIntegrations`. | ||
| */ | ||
| export function getDefaultIntegrations(options: CloudflareOptions): Integration[] { | ||
| return [ | ||
| ...getBaseDefaultIntegrations(options), | ||
| // Subscribes to the `ai` SDK's native `node:diagnostics_channel` telemetry channel. | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| // Note: For now we add this directly here, in order for this to be here for vercel AI v7 | ||
| // Generally, we auto-inject integrations based on what orchestrion is using | ||
| // however, for things with native channel support (like ai v7) we do not know about this | ||
| // we'll fix this in a follow up, but for the time being vercelAIIntegration is added here | ||
| // TODO: Remove this once we auto-inject integrations for native channels as well | ||
| vercelAIIntegration(), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default and public integrations divergeMedium Severity The default Reviewed by Cursor Bugbot for commit a3f614e. Configure here. |
||
| ]; | ||
| } | ||
|
|
||
| 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'; |
| 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 was deleted.


Uh oh!
There was an error while loading. Please reload this page.