Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { D1Database } from '@cloudflare/workers-types';
import { PrismaD1 } from '@prisma/adapter-d1';
import * as Sentry from '@sentry/cloudflare/nodejs_compat';
import * as Sentry from '@sentry/cloudflare';
import { PrismaClient } from './generated';

interface Env {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function envelopeItem(envelope: Envelope): Record<string, unknown> {
return envelope[1][0]![1] as Record<string, unknown>;
}

it('captures a transaction with Prisma spans for a D1 query via the @sentry/cloudflare/nodejs_compat prismaIntegration', async ({
it('captures a transaction with Prisma spans for a D1 query via the @sentry/cloudflare prismaIntegration', async ({
signal,
}) => {
const runner = createRunner(__dirname)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from '@sentry/cloudflare/nodejs_compat';
import * as Sentry from '@sentry/cloudflare';
import { generateText } from 'ai';
import { MockLanguageModelV3 } from 'ai/test';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.describe('Worker V8 isolate memory tests', () => {
// Compare batches to detect per-request leaks (excludes warm-up effects)
const result = profiler.compareSnapshots(afterFirstBatch, afterSecondBatch);

expect(result.nodeGrowthPercent).toBeLessThan(0.25);
expect(result.nodeGrowthPercent).toBeLessThan(0.27);

await profiler.close();
});
Expand Down
5 changes: 0 additions & 5 deletions packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
"import": "./build/esm/prod/request.js",
"require": "./build/cjs/prod/request.js"
},
"./nodejs_compat": {
"types": "./build/types/nodejs_compat/index.d.ts",
"import": "./build/esm/prod/nodejs_compat/index.js",
"require": "./build/cjs/prod/nodejs_compat/index.js"
},
"./vite": {
"types": "./build/types/vite/index.d.ts",
"import": "./build/esm/prod/vite/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu

export default makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.ts', 'src/request.ts', 'src/nodejs_compat/index.ts', 'src/vite/index.ts'],
entrypoints: ['src/index.ts', 'src/request.ts', 'src/vite/index.ts'],
}),
{ splitDevProd: true },
);
1 change: 1 addition & 0 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export { httpServerIntegration } from './integrations/httpServer';
export { fetchIntegration } from './integrations/fetch';
export { spotlightIntegration } from './integrations/spotlight';
export { vercelAIIntegration } from './integrations/tracing/vercelai';
export { prismaIntegration } from '@sentry/server-utils';

// eslint-disable-next-line typescript/no-deprecated
export { instrumentD1WithSentry } from './instrumentations/worker/instrumentD1';
Expand Down
25 changes: 6 additions & 19 deletions packages/cloudflare/src/integrations/tracing/vercelai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,18 @@
*/

import type { IntegrationFn } from '@sentry/core';
import { addVercelAiProcessors, defineIntegration } from '@sentry/core';

const INTEGRATION_NAME = 'VercelAI';

interface VercelAiOptions {
/**
* Enable or disable truncation of recorded input messages.
* Defaults to `true`.
*/
enableTruncation?: boolean;

// `recordInputs`/`recordOutputs` are intentionally omitted: this entrypoint only post-processes
// spans the AI SDK already emitted, so it cannot decide whether inputs/outputs are recorded.
// Control this per call via `experimental_telemetry.recordInputs`/`recordOutputs`, or use the
// `@sentry/cloudflare/nodejs_compat` entrypoint for integration-level control on ai >= 7.
}
import { addVercelAiProcessors, defineIntegration, extendIntegration } from '@sentry/core';
import { vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';

const _vercelAIIntegration = ((options: VercelAiOptions = {}) => {
return {
name: INTEGRATION_NAME,
const inner = vercelAiIntegration(options);

return extendIntegration(inner, {
options,
setup(client) {
addVercelAiProcessors(client);
},
};
});
Comment thread
JPeer264 marked this conversation as resolved.
}) satisfies IntegrationFn;

/**
Expand Down
3 changes: 0 additions & 3 deletions packages/cloudflare/src/nodejs_compat/index.ts

This file was deleted.

Loading
Loading