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
@@ -0,0 +1,13 @@
import http from 'http';

export const dynamic = 'force-dynamic';

export default async function Page() {
await fetch('http://example.com/');
await new Promise<void>(resolve => {
http.get('http://example.com/', () => {
resolve();
});
});
return <p>Hello World!</p>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { expect, test } from '@playwright/test';
import { waitForTransaction } from '../event-proxy-server';

test('Should send a transaction with a fetch span', async ({ page }) => {
const transactionPromise = waitForTransaction('nextjs-14', async transactionEvent => {
return transactionEvent?.transaction === 'Page Server Component (/request-instrumentation)';
});

await page.goto(`/request-instrumentation`);

expect((await transactionPromise).spans).toContainEqual(
expect.objectContaining({
data: expect.objectContaining({
'http.method': 'GET',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.node.undici',
}),
description: 'GET http://example.com/',
}),
);

expect((await transactionPromise).spans).toContainEqual(
expect.objectContaining({
data: expect.objectContaining({
'http.method': 'GET',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.node.http',
}),
description: 'GET http://example.com/',
}),
);
});