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
Expand Up @@ -7,6 +7,7 @@ Sentry.init({
tracePropagationTargets: [/\/v0/, 'v1'],
integrations: [],
transport: loggingTransport,
tracesSampleRate: 0.0,
// Ensure this gets a correct hint
beforeBreadcrumb(breadcrumb, hint) {
breadcrumb.data = breadcrumb.data || {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ Sentry.init({
tracePropagationTargets: [/\/v0/, 'v1'],
integrations: [],
transport: loggingTransport,
// Ensure this gets a correct hint
beforeBreadcrumb(breadcrumb, hint) {
breadcrumb.data = breadcrumb.data || {};
const req = hint?.request as { path?: string };
breadcrumb.data.ADDED_PATH = req?.path;
return breadcrumb;
},
});

import * as http from 'http';

async function run(): Promise<void> {
Sentry.addBreadcrumb({ message: 'manual breadcrumb' });

await makeHttpRequest(`${process.env.SERVER_URL}/api/v0`);
await makeHttpGet(`${process.env.SERVER_URL}/api/v1`);
await makeHttpRequest(`${process.env.SERVER_URL}/api/v2`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test('outgoing http requests are correctly instrumented with tracing disabled',
data: {
'http.method': 'GET',
url: `${SERVER_URL}/api/v0`,
status_code: 404,
status_code: 200,
ADDED_PATH: '/api/v0',
},
timestamp: expect.any(Number),
Expand All @@ -59,7 +59,7 @@ test('outgoing http requests are correctly instrumented with tracing disabled',
data: {
'http.method': 'GET',
url: `${SERVER_URL}/api/v1`,
status_code: 404,
status_code: 200,
ADDED_PATH: '/api/v1',
},
timestamp: expect.any(Number),
Expand All @@ -70,7 +70,7 @@ test('outgoing http requests are correctly instrumented with tracing disabled',
data: {
'http.method': 'GET',
url: `${SERVER_URL}/api/v2`,
status_code: 404,
status_code: 200,
ADDED_PATH: '/api/v2',
},
timestamp: expect.any(Number),
Expand All @@ -81,7 +81,7 @@ test('outgoing http requests are correctly instrumented with tracing disabled',
data: {
'http.method': 'GET',
url: `${SERVER_URL}/api/v3`,
status_code: 404,
status_code: 200,
ADDED_PATH: '/api/v3',
},
timestamp: expect.any(Number),
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/node-integration-tests/utils/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export function createTestServer(done: (error?: unknown) => void) {
const address = server.address() as AddressInfo;
resolve([
`http://localhost:${address.port}`,
() => {
(error?: unknown) => {
server.close();
done();
done(error);
},
]);
});
Expand Down
Loading