Skip to content

Commit 6c68d0e

Browse files
committed
remove modules
1 parent 9b8f5f0 commit 6c68d0e

File tree

5 files changed

+10
-224
lines changed

5 files changed

+10
-224
lines changed

packages/cloudflare/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export { getDefaultIntegrations } from './sdk';
108108

109109
export { fetchIntegration } from './integrations/fetch';
110110
export { vercelAIIntegration } from './integrations/tracing/vercelai';
111-
export { modulesIntegration } from './integrations/modules';
112111

113112
export { instrumentD1WithSentry } from './d1';
114113

packages/cloudflare/src/integrations/modules.ts

Lines changed: 0 additions & 183 deletions
This file was deleted.

packages/cloudflare/src/integrations/tracing/vercelai.ts

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,27 @@
88
* and users have to manually set this to get spans.
99
*/
1010

11-
import type { Client, IntegrationFn } from '@sentry/core';
11+
import type { IntegrationFn } from '@sentry/core';
1212
import { addVercelAiProcessors, defineIntegration } from '@sentry/core';
13-
import type { modulesIntegration } from '../modules';
14-
15-
interface VercelAiOptions {
16-
/**
17-
* By default, the instrumentation will register span processors only when the ai package is used.
18-
* If you want to register the span processors even when the ai package usage cannot be detected, you can set `force` to `true`.
19-
*/
20-
force?: boolean;
21-
}
2213

2314
const INTEGRATION_NAME = 'VercelAI';
2415

25-
/**
26-
* Determines if the integration should be forced based on environment and package availability.
27-
* Returns true if the 'ai' package is available.
28-
*/
29-
function shouldRunIntegration(client: Client): boolean {
30-
const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');
31-
return !!modules?.getModules?.()?.ai;
32-
}
33-
34-
const _vercelAIIntegration = ((options: VercelAiOptions = {}) => {
16+
const _vercelAIIntegration = (() => {
3517
return {
3618
name: INTEGRATION_NAME,
37-
options,
3819
setup(client) {
39-
if (options.force || shouldRunIntegration(client)) {
40-
addVercelAiProcessors(client);
41-
}
20+
addVercelAiProcessors(client);
4221
},
4322
};
4423
}) satisfies IntegrationFn;
4524

4625
/**
4726
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
27+
* This integration is not enabled by default, you need to manually add it.
4828
*
4929
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
5030
*
51-
* The integration automatically detects when to force registration
52-
* when the 'ai' package is available. You can still manually set the `force` option if needed.
53-
*
54-
* Unlike the Vercel AI integration in the node SDK, this integration does not add tracing support to
55-
* `ai` function calls. You need to enable collecting spans for a specific call by setting
31+
* You need to enable collecting spans for a specific call by setting
5632
* `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
5733
*
5834
* ```javascript

packages/cloudflare/src/sdk.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import {
1313
import type { CloudflareClientOptions, CloudflareOptions } from './client';
1414
import { CloudflareClient } from './client';
1515
import { fetchIntegration } from './integrations/fetch';
16-
import { modulesIntegration } from './integrations/modules';
17-
import { vercelAIIntegration } from './integrations/tracing/vercelai';
1816
import { setupOpenTelemetryTracer } from './opentelemetry/tracer';
1917
import { makeCloudflareTransport } from './transport';
2018
import { defaultStackParser } from './vendor/stacktrace';
@@ -32,11 +30,9 @@ export function getDefaultIntegrations(options: CloudflareOptions): Integration[
3230
functionToStringIntegration(),
3331
linkedErrorsIntegration(),
3432
fetchIntegration(),
35-
modulesIntegration(),
3633
// TODO(v10): the `include` object should be defined directly in the integration based on `sendDefaultPii`
3734
requestDataIntegration(sendDefaultPii ? undefined : { include: { cookies: false } }),
3835
consoleIntegration(),
39-
vercelAIIntegration(),
4036
];
4137
}
4238

packages/node/src/integrations/tracing/vercelai/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const _vercelAIIntegration = ((options: VercelAiOptions = {}) => {
4242

4343
/**
4444
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
45+
* This integration is not enabled by default, you need to manually add it.
4546
*
4647
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
4748
*
@@ -54,17 +55,14 @@ const _vercelAIIntegration = ((options: VercelAiOptions = {}) => {
5455
* });
5556
* ```
5657
*
57-
* The integration automatically detects when to force registration in CommonJS environments
58-
* when the 'ai' package is available. You can still manually set the `force` option if needed.
59-
*
60-
* By default this integration adds tracing support to all `ai` function calls. If you need to disable
61-
* collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to
62-
* `false` in the first argument of the function call.
58+
* This integration adds tracing support to all `ai` function calls.
59+
* You need to opt-in to collecting spans for a specific call,
60+
* you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
6361
*
6462
* ```javascript
6563
* const result = await generateText({
6664
* model: openai('gpt-4-turbo'),
67-
* experimental_telemetry: { isEnabled: false },
65+
* experimental_telemetry: { isEnabled: true },
6866
* });
6967
* ```
7068
*

0 commit comments

Comments
 (0)