Skip to content

Commit 1683caf

Browse files
authored
feat(node): Make Undici a default integration. (#7967)
1 parent d1b09c6 commit 1683caf

File tree

5 files changed

+3
-28
lines changed

5 files changed

+3
-28
lines changed

packages/nextjs/src/server/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ function addServerIntegrations(options: NodeOptions): void {
146146
});
147147
}
148148

149-
integrations = addOrUpdateIntegration(new Integrations.Undici(), integrations);
150-
151149
options.integrations = integrations;
152150
}
153151

packages/nextjs/test/serverSdk.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,6 @@ describe('Server init()', () => {
164164
expect(consoleIntegration).toBeDefined();
165165
});
166166

167-
it('adds the Undici integration', () => {
168-
init({});
169-
170-
const nodeInitOptions = nodeInit.mock.calls[0][0] as ModifiedInitOptions;
171-
const undiciIntegration = findIntegrationByName(nodeInitOptions.integrations, 'Undici');
172-
173-
expect(undiciIntegration).toBeDefined();
174-
});
175-
176167
describe('`Http` integration', () => {
177168
it('adds `Http` integration with tracing enabled if `tracesSampleRate` is set', () => {
178169
init({ tracesSampleRate: 1.0 });

packages/node/src/sdk.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
OnUncaughtException,
2929
OnUnhandledRejection,
3030
RequestData,
31+
Undici,
3132
} from './integrations';
3233
import { getModule } from './module';
3334
import { makeNodeTransport } from './transports';
@@ -40,6 +41,7 @@ export const defaultIntegrations = [
4041
// Native Wrappers
4142
new Console(),
4243
new Http(),
44+
new Undici(),
4345
// Global Handlers
4446
new OnUncaughtException(),
4547
new OnUnhandledRejection(),

packages/sveltekit/src/server/sdk.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { configureScope } from '@sentry/core';
22
import { RewriteFrames } from '@sentry/integrations';
33
import type { NodeOptions } from '@sentry/node';
4-
import { init as initNodeSdk, Integrations } from '@sentry/node';
4+
import { init as initNodeSdk } from '@sentry/node';
55
import { addOrUpdateIntegration } from '@sentry/utils';
66

77
import { applySdkMetadata } from '../common/metadata';
@@ -24,7 +24,6 @@ export function init(options: NodeOptions): void {
2424
}
2525

2626
function addServerIntegrations(options: NodeOptions): void {
27-
options.integrations = addOrUpdateIntegration(new Integrations.Undici(), options.integrations || []);
2827
options.integrations = addOrUpdateIntegration(
2928
new RewriteFrames({ iteratee: rewriteFramesIteratee }),
3029
options.integrations || [],

packages/sveltekit/test/server/sdk.test.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,5 @@ describe('Sentry server SDK', () => {
4747
// @ts-ignore need access to protected _tags attribute
4848
expect(currentScope._tags).toEqual({ runtime: 'node' });
4949
});
50-
51-
it('adds the Undici integration', () => {
52-
init({});
53-
54-
expect(nodeInit).toHaveBeenCalledTimes(1);
55-
expect(nodeInit).toHaveBeenCalledWith(
56-
expect.objectContaining({
57-
integrations: expect.arrayContaining([
58-
expect.objectContaining({
59-
name: 'Undici',
60-
}),
61-
]),
62-
}),
63-
);
64-
});
6550
});
6651
});

0 commit comments

Comments
 (0)