Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ sentryTest('should update spans for GraphQL fetch requests', async ({ getLocalTe
data: expect.objectContaining({
type: 'fetch',
'http.method': 'POST',
'http.url': 'http://sentry-test.io/foo',
'url.full': 'http://sentry-test.io/foo',
url: 'http://sentry-test.io/foo',
Comment thread
cursor[bot] marked this conversation as resolved.
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ sentryTest('should update spans for GraphQL persisted query fetch requests', asy
data: expect.objectContaining({
type: 'fetch',
'http.method': 'POST',
'http.url': 'http://sentry-test.io/graphql',
'url.full': 'http://sentry-test.io/graphql',
url: 'http://sentry-test.io/graphql',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ sentryTest('should update spans for GraphQL persisted query XHR requests', async
data: {
type: 'xhr',
'http.method': 'POST',
'http.url': 'http://sentry-test.io/graphql',
'url.full': 'http://sentry-test.io/graphql',
url: 'http://sentry-test.io/graphql',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ sentryTest('should update spans for GraphQL XHR requests', async ({ getLocalTest
data: {
type: 'xhr',
'http.method': 'POST',
'http.url': 'http://sentry-test.io/foo',
'url.full': 'http://sentry-test.io/foo',
url: 'http://sentry-test.io/foo',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ sentryTest('sanitizes data URLs in fetch span name and attributes', async ({ get

expect(span?.data).toMatchObject({
'http.method': 'GET',
url: sanitizedUrl,
type: 'fetch',
});

expect(span?.data?.['http.url']).toBe(sanitizedUrl);
expect(span?.data?.['url.full']).toBe(sanitizedUrl);
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ sentryTest('should create spans for fetch requests called directly after init',
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/0',
'url.full': 'http://sentry-test-site.example/0',
url: 'http://sentry-test-site.example/0',
'server.address': 'sentry-test-site.example',
type: 'fetch',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `${TEST_HOST}/test-req/${index}`,
'url.full': `${TEST_HOST}/test-req/${index}`,
url: `/test-req/${index}`,
'server.address': 'sentry-test.io',
type: 'fetch',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sentryTest(
name: 'GET http://sentry-test-site.example/delayed',
attributes: expect.objectContaining({
'http.method': { type: 'string', value: 'GET' },
url: { type: 'string', value: 'http://sentry-test-site.example/delayed' },
'url.full': { type: 'string', value: 'http://sentry-test-site.example/delayed' },
type: { type: 'string', value: 'fetch' },
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sentryTest('creates spans for fetch requests', async ({ getLocalTestUrl, page })
const requestSpans = allSpans
.filter(s => getSpanOp(s) === 'http.client')
.sort((a, b) =>
(a.attributes!['http.url']!.value as string).localeCompare(b.attributes!['http.url']!.value as string),
(a.attributes!['url.full']!.value as string).localeCompare(b.attributes!['url.full']!.value as string),
);

expect(requestSpans).toHaveLength(3);
Expand All @@ -37,9 +37,7 @@ sentryTest('creates spans for fetch requests', async ({ getLocalTestUrl, page })
trace_id: pageloadSpan?.trace_id,
attributes: expect.objectContaining({
'http.method': { type: 'string', value: 'GET' },
'http.url': { type: 'string', value: `http://sentry-test-site.example/${index}` },
'url.full': { type: 'string', value: `http://sentry-test-site.example/${index}` },
url: { type: 'string', value: `http://sentry-test-site.example/${index}` },
'server.address': { type: 'string', value: 'sentry-test-site.example' },
type: { type: 'string', value: 'fetch' },
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ sentryTest('strips query params in fetch request spans', async ({ getLocalTestUr
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/0?id=123;page=5',
'url.full': 'http://sentry-test-site.example/0?id=123;page=5',
'http.query': '?id=123;page=5',
'url.query': 'id=123;page=5',
'http.response.status_code': 200,
'http.response_content_length': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
'server.address': 'sentry-test-site.example',
url: 'http://sentry-test-site.example/0?id=123;page=5',
}),
});

expect(requestSpan?.data).not.toHaveProperty('http.fragment');
expect(requestSpan?.data).not.toHaveProperty('url.fragment');
});

sentryTest('strips hash fragment in fetch request spans', async ({ getLocalTestUrl, page }) => {
Expand Down Expand Up @@ -74,20 +72,18 @@ sentryTest('strips hash fragment in fetch request spans', async ({ getLocalTestU
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/1#fragment',
'url.full': 'http://sentry-test-site.example/1#fragment',
'http.fragment': '#fragment',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'http.response_content_length': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
'server.address': 'sentry-test-site.example',
url: 'http://sentry-test-site.example/1#fragment',
}),
});

expect(requestSpan?.data).not.toHaveProperty('http.query');
expect(requestSpan?.data).not.toHaveProperty('url.query');
});

sentryTest('strips hash fragment and query params in fetch request spans', async ({ getLocalTestUrl, page }) => {
Expand Down Expand Up @@ -118,17 +114,15 @@ sentryTest('strips hash fragment and query params in fetch request spans', async
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/2?id=1#fragment',
'url.full': 'http://sentry-test-site.example/2?id=1#fragment',
'http.query': '?id=1',
'http.fragment': '#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'http.response_content_length': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
'server.address': 'sentry-test-site.example',
url: 'http://sentry-test-site.example/2?id=1#fragment',
}),
});
});
Expand Down Expand Up @@ -163,17 +157,15 @@ sentryTest(
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test.io/api/users?id=1#fragment',
'url.full': 'http://sentry-test.io/api/users?id=1#fragment',
'http.query': '?id=1',
'http.fragment': '#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'http.response_content_length': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
'server.address': 'sentry-test.io',
url: '/api/users?id=1#fragment',
}),
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `http://sentry-test-site.example/${index}`,
'url.full': `http://sentry-test-site.example/${index}`,
url: `http://sentry-test-site.example/${index}`,
'server.address': 'sentry-test-site.example',
type: 'fetch',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ sentryTest('sanitizes data URLs in XHR span name and attributes', async ({ getLo

expect(span?.data).toMatchObject({
'http.method': 'GET',
url: sanitizedUrl,
type: 'xhr',
});

expect(span?.data?.['http.url']).toBe(sanitizedUrl);
expect(span?.data?.['url.full']).toBe(sanitizedUrl);
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ sentryTest('should create spans for xhr requests', async ({ getLocalTestUrl, pag
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `${TEST_HOST}/test-req/${index}`,
'url.full': `${TEST_HOST}/test-req/${index}`,
url: `/test-req/${index}`,
'server.address': 'sentry-test.io',
type: 'xhr',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sentryTest('creates spans for XHR requests', async ({ getLocalTestUrl, page }) =
const requestSpans = allSpans
.filter(s => getSpanOp(s) === 'http.client')
.sort((a, b) =>
(a.attributes!['http.url']!.value as string).localeCompare(b.attributes!['http.url']!.value as string),
(a.attributes!['url.full']!.value as string).localeCompare(b.attributes!['url.full']!.value as string),
);

expect(requestSpans).toHaveLength(3);
Expand All @@ -37,9 +37,7 @@ sentryTest('creates spans for XHR requests', async ({ getLocalTestUrl, page }) =
trace_id: pageloadSpan?.trace_id,
attributes: expect.objectContaining({
'http.method': { type: 'string', value: 'GET' },
'http.url': { type: 'string', value: `http://sentry-test-site.example/${index}` },
'url.full': { type: 'string', value: `http://sentry-test-site.example/${index}` },
url: { type: 'string', value: `http://sentry-test-site.example/${index}` },
'server.address': { type: 'string', value: 'sentry-test-site.example' },
type: { type: 'string', value: 'xhr' },
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ sentryTest('strips query params in XHR request spans', async ({ getLocalTestUrl,
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/0?id=123;page=5',
'url.full': 'http://sentry-test-site.example/0?id=123;page=5',
'http.query': '?id=123;page=5',
'url.query': 'id=123;page=5',
'http.response.status_code': 200,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'xhr',
'server.address': 'sentry-test-site.example',
url: 'http://sentry-test-site.example/0?id=123;page=5',
}),
});

expect(requestSpan?.data).not.toHaveProperty('http.fragment');
expect(requestSpan?.data).not.toHaveProperty('url.fragment');
});

sentryTest('strips hash fragment in XHR request spans', async ({ getLocalTestUrl, page }) => {
Expand Down Expand Up @@ -73,19 +71,17 @@ sentryTest('strips hash fragment in XHR request spans', async ({ getLocalTestUrl
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/1#fragment',
'url.full': 'http://sentry-test-site.example/1#fragment',
'http.fragment': '#fragment',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'xhr',
'server.address': 'sentry-test-site.example',
url: 'http://sentry-test-site.example/1#fragment',
}),
});

expect(requestSpan?.data).not.toHaveProperty('http.query');
expect(requestSpan?.data).not.toHaveProperty('url.query');
});

sentryTest('strips hash fragment and query params in XHR request spans', async ({ getLocalTestUrl, page }) => {
Expand Down Expand Up @@ -116,16 +112,14 @@ sentryTest('strips hash fragment and query params in XHR request spans', async (
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test-site.example/2?id=1#fragment',
'url.full': 'http://sentry-test-site.example/2?id=1#fragment',
'http.query': '?id=1',
'http.fragment': '#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'xhr',
'server.address': 'sentry-test-site.example',
url: 'http://sentry-test-site.example/2?id=1#fragment',
}),
});
});
Expand Down Expand Up @@ -160,16 +154,14 @@ sentryTest(
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.url': 'http://sentry-test.io/api/users?id=1#fragment',
'url.full': 'http://sentry-test.io/api/users?id=1#fragment',
'http.query': '?id=1',
'http.fragment': '#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'xhr',
'server.address': 'sentry-test.io',
url: '/api/users?id=1#fragment',
}),
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestUrl, pag
trace_id: eventData.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `http://sentry-test-site.example/${index}`,
'url.full': `http://sentry-test-site.example/${index}`,
url: `http://sentry-test-site.example/${index}`,
'server.address': 'sentry-test-site.example',
type: 'xhr',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test.describe('tracing in dynamically rendered (ssr) routes', () => {
'sentry.origin': 'auto.http.astro',
'sentry.sample_rate': 1,
'sentry.source': 'route',
url: expect.stringContaining('/test-ssr'),
'url.full': expect.stringContaining('/test-ssr'),
'http.request.header.accept': expect.any(String),
'http.request.header.accept_encoding': 'gzip, deflate, br, zstd',
'http.request.header.accept_language': 'en-US',
Expand Down Expand Up @@ -230,7 +230,7 @@ test.describe('nested SSR routes (client, server, server request)', () => {
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.astro',
'sentry.source': 'route',
url: expect.stringContaining('/user-page/myUsername123'),
'url.full': expect.stringContaining('/user-page/myUsername123'),
'http.request.header.accept': expect.any(String),
'http.request.header.accept_encoding': 'gzip, deflate, br, zstd',
'http.request.header.accept_language': 'en-US',
Expand All @@ -252,7 +252,6 @@ test.describe('nested SSR routes (client, server, server request)', () => {
'sentry.origin': 'auto.http.otel.node_fetch',
'url.full': expect.stringContaining('/api/user/myUsername123.json'),
'url.path': '/api/user/myUsername123.json',
url: expect.stringContaining('/api/user/myUsername123.json'),
},
});

Expand All @@ -268,7 +267,7 @@ test.describe('nested SSR routes (client, server, server request)', () => {
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.astro',
'sentry.source': 'route',
url: expect.stringContaining('/api/user/myUsername123.json'),
'url.full': expect.stringContaining('/api/user/myUsername123.json'),
'http.request.header.accept': expect.any(String),
'http.request.header.accept_encoding': 'gzip, deflate',
'http.request.header.accept_language': '*',
Expand Down Expand Up @@ -325,7 +324,7 @@ test.describe('nested SSR routes (client, server, server request)', () => {
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.astro',
'sentry.source': 'route',
url: expect.stringContaining('/catchAll/hell0/whatever-do'),
'url.full': expect.stringContaining('/catchAll/hell0/whatever-do'),
'http.request.header.accept': expect.any(String),
'http.request.header.accept_encoding': 'gzip, deflate, br, zstd',
'http.request.header.accept_language': 'en-US',
Expand Down Expand Up @@ -382,7 +381,7 @@ test.describe('parametrized vs static paths', () => {
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.astro',
'sentry.source': 'route',
url: expect.stringContaining('/user-page/settings'),
'url.full': expect.stringContaining('/user-page/settings'),
'http.request.header.accept': expect.any(String),
'http.request.header.accept_encoding': 'gzip, deflate, br, zstd',
'http.request.header.accept_language': 'en-US',
Expand Down
Loading
Loading