Skip to content

Commit 9e98330

Browse files
authored
feat(nextjs): Add Undici integration automatically (#7648)
1 parent 1b04113 commit 9e98330

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/nextjs/src/server/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ function addServerIntegrations(options: NodeOptions): void {
174174
});
175175
}
176176

177+
integrations = addOrUpdateIntegration(new Integrations.Undici(), integrations);
178+
177179
options.integrations = integrations;
178180
}
179181

packages/nextjs/test/serverSdk.test.ts

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

164+
it('adds the Undici integration', () => {
165+
init({});
166+
167+
const nodeInitOptions = nodeInit.mock.calls[0][0] as ModifiedInitOptions;
168+
const undiciIntegration = findIntegrationByName(nodeInitOptions.integrations, 'Undici');
169+
170+
expect(undiciIntegration).toBeDefined();
171+
});
172+
164173
describe('`Http` integration', () => {
165174
it('adds `Http` integration with tracing enabled if `tracesSampleRate` is set', () => {
166175
init({ tracesSampleRate: 1.0 });

0 commit comments

Comments
 (0)