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 @@ -48,7 +48,7 @@ sentryTest('should update spans for GraphQL fetch requests', async ({ getLocalTe
status: 'ok',
data: expect.objectContaining({
type: 'fetch',
'http.method': 'POST',
'http.request.method': 'POST',
'url.full': 'http://sentry-test.io/foo',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sentryTest('should update spans for GraphQL persisted query fetch requests', asy
status: 'ok',
data: expect.objectContaining({
type: 'fetch',
'http.method': 'POST',
'http.request.method': 'POST',
'url.full': 'http://sentry-test.io/graphql',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sentryTest('should update spans for GraphQL persisted query XHR requests', async
status: 'ok',
data: {
type: 'xhr',
'http.method': 'POST',
'http.request.method': 'POST',
'url.full': 'http://sentry-test.io/graphql',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sentryTest('should update spans for GraphQL XHR requests', async ({ getLocalTest
status: 'ok',
data: {
type: 'xhr',
'http.method': 'POST',
'http.request.method': 'POST',
'url.full': 'http://sentry-test.io/foo',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ window.Sentry = Sentry;
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.spanStreamingIntegration()],
ignoreSpans: [{ attributes: { 'http.status_code': 200 } }],
ignoreSpans: [{ attributes: { 'http.response.status_code': 200 } }],
tracesSampleRate: 1,
debug: true,
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// This segment span matches ignoreSpans via attributes — segment + child should be dropped
Sentry.startSpan({ name: 'health-check', attributes: { 'http.status_code': 200 } }, () => {
Sentry.startSpan({ name: 'health-check', attributes: { 'http.response.status_code': 200 } }, () => {
Sentry.startSpan({ name: 'child-of-ignored' }, () => {});
});

setTimeout(() => {
// This segment span does NOT match — segment + child should be sent
Sentry.startSpan({ name: 'normal-segment', attributes: { 'http.status_code': 500 } }, () => {
Sentry.startSpan({ name: 'normal-segment', attributes: { 'http.response.status_code': 500 } }, () => {
Sentry.startSpan({ name: 'child-span' }, () => {});
});
}, 1000);
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
// The init bundle script is served from the test origin: its description is origin-relative,
// but `url.full` retains the full absolute URL (needed for span description inference).
const sameOriginScriptSpan = scriptSpans?.find(({ description }) => description === '/init.bundle.js');
expect(sameOriginScriptSpan?.data?.['url.same_origin']).toBe(true);
expect(sameOriginScriptSpan?.data?.['http.request.same_origin']).toBe(true);
expect(sameOriginScriptSpan?.data?.['url.full']).toMatch(/^https?:\/\/.+\/init\.bundle\.js$/);

const customScriptSpan = scriptSpans?.find(
Expand All @@ -77,9 +77,9 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU

expect(imgSpan).toEqual({
data: {
'http.decoded_response_content_length': expect.any(Number),
'http.response_content_length': expect.any(Number),
'http.response_transfer_size': expect.any(Number),
'http.response.body.decoded_size': expect.any(Number),
'http.response.body.size': expect.any(Number),
'http.response.size': expect.any(Number),
'http.request.connect_start': expect.any(Number),
'http.request.connection_end': expect.any(Number),
'http.request.domain_lookup_end': expect.any(Number),
Expand All @@ -99,7 +99,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',
'server.address': 'sentry-test-site.example',
'url.domain': 'sentry-test-site.example',
'url.same_origin': false,
'http.request.same_origin': false,
'url.scheme': 'https',
'url.full': 'https://sentry-test-site.example/path/to/image.svg',
...(!isWebkitRun && {
Expand Down Expand Up @@ -127,9 +127,9 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU

expect(linkSpan).toEqual({
data: {
'http.decoded_response_content_length': expect.any(Number),
'http.response_content_length': expect.any(Number),
'http.response_transfer_size': expect.any(Number),
'http.response.body.decoded_size': expect.any(Number),
'http.response.body.size': expect.any(Number),
'http.response.size': expect.any(Number),
'http.request.connect_start': expect.any(Number),
'http.request.connection_end': expect.any(Number),
'http.request.domain_lookup_end': expect.any(Number),
Expand All @@ -149,7 +149,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.resource.browser.metrics',
'server.address': 'sentry-test-site.example',
'url.domain': 'sentry-test-site.example',
'url.same_origin': false,
'http.request.same_origin': false,
'url.scheme': 'https',
'url.full': 'https://sentry-test-site.example/path/to/style.css',
...(!isWebkitRun && {
Expand All @@ -171,9 +171,9 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU

expect(customScriptSpan).toEqual({
data: {
'http.decoded_response_content_length': expect.any(Number),
'http.response_content_length': expect.any(Number),
'http.response_transfer_size': expect.any(Number),
'http.response.body.decoded_size': expect.any(Number),
'http.response.body.size': expect.any(Number),
'http.response.size': expect.any(Number),
'http.request.connection_end': expect.any(Number),
'http.request.connect_start': expect.any(Number),
'http.request.domain_lookup_end': expect.any(Number),
Expand All @@ -193,7 +193,7 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
'sentry.origin': 'auto.resource.browser.metrics',
'server.address': 'sentry-test-site.example',
'url.domain': 'sentry-test-site.example',
'url.same_origin': false,
'http.request.same_origin': false,
'url.scheme': 'https',
'url.full': 'https://sentry-test-site.example/path/to/script.js',
...(!isWebkitRun && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sentryTest('sanitizes data URLs in fetch span name and attributes', async ({ get
expect(span?.description).toBe(`GET ${sanitizedUrl}`);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sentryTest('should create spans for fetch requests called directly after init',
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': '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 @@ -28,7 +28,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': `${TEST_HOST}/test-req/${index}`,
'server.address': 'sentry-test.io',
type: 'fetch',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sentryTest(
expect(streamSpan).toMatchObject({
name: 'GET http://sentry-test-site.example/delayed',
attributes: expect.objectContaining({
'http.method': { type: 'string', value: 'GET' },
'http.request.method': { type: 'string', value: 'GET' },
'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 @@ -36,7 +36,7 @@ sentryTest('creates spans for fetch requests', async ({ getLocalTestUrl, page })
end_timestamp: expect.any(Number),
trace_id: pageloadSpan?.trace_id,
attributes: expect.objectContaining({
'http.method': { type: 'string', value: 'GET' },
'http.request.method': { type: 'string', value: 'GET' },
'url.full': { 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 @@ -29,11 +29,11 @@ sentryTest('strips query params in fetch request spans', async ({ getLocalTestUr
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test-site.example/0?id=123;page=5',
'url.query': 'id=123;page=5',
'http.response.status_code': 200,
'http.response_content_length': 2,
'http.response.body.size': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
Expand Down Expand Up @@ -71,11 +71,11 @@ sentryTest('strips hash fragment in fetch request spans', async ({ getLocalTestU
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test-site.example/1#fragment',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'http.response_content_length': 2,
'http.response.body.size': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
Expand Down Expand Up @@ -113,12 +113,12 @@ sentryTest('strips hash fragment and query params in fetch request spans', async
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test-site.example/2?id=1#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'http.response_content_length': 2,
'http.response.body.size': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
Expand Down Expand Up @@ -156,12 +156,12 @@ sentryTest(
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test.io/api/users?id=1#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
'http.response.status_code': 200,
'http.response_content_length': 2,
'http.response.body.size': 2,
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.browser',
type: 'fetch',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, p
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': `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 @@ -21,7 +21,7 @@ sentryTest('sanitizes data URLs in XHR span name and attributes', async ({ getLo
expect(span?.description).toBe(`GET ${sanitizedUrl}`);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sentryTest('should create spans for xhr requests', async ({ getLocalTestUrl, pag
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': `${TEST_HOST}/test-req/${index}`,
'server.address': 'sentry-test.io',
type: 'xhr',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sentryTest('creates spans for XHR requests', async ({ getLocalTestUrl, page }) =
end_timestamp: expect.any(Number),
trace_id: pageloadSpan?.trace_id,
attributes: expect.objectContaining({
'http.method': { type: 'string', value: 'GET' },
'http.request.method': { type: 'string', value: 'GET' },
'url.full': { 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 @@ -29,7 +29,7 @@ sentryTest('strips query params in XHR request spans', async ({ getLocalTestUrl,
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test-site.example/0?id=123;page=5',
'url.query': 'id=123;page=5',
'http.response.status_code': 200,
Expand Down Expand Up @@ -70,7 +70,7 @@ sentryTest('strips hash fragment in XHR request spans', async ({ getLocalTestUrl
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test-site.example/1#fragment',
'url.fragment': 'fragment',
'http.response.status_code': 200,
Expand Down Expand Up @@ -111,7 +111,7 @@ sentryTest('strips hash fragment and query params in XHR request spans', async (
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test-site.example/2?id=1#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
Expand Down Expand Up @@ -153,7 +153,7 @@ sentryTest(
timestamp: expect.any(Number),
trace_id: transactionEvent.contexts?.trace?.trace_id,
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': 'http://sentry-test.io/api/users?id=1#fragment',
'url.query': 'id=1',
'url.fragment': 'fragment',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestUrl, pag
timestamp: expect.any(Number),
trace_id: eventData.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.request.method': 'GET',
'url.full': `http://sentry-test-site.example/${index}`,
'server.address': 'sentry-test-site.example',
type: 'xhr',
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/bun-integration-tests/suites/fetch/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ it('creates an http.client span for outgoing fetch requests', async ({ signal })
origin: 'auto.http.fetch',
description: expect.stringMatching(/^GET http:\/\/localhost:\d+\/allowed$/),
data: expect.objectContaining({
'http.method': 'GET',
'http.request.method': 'GET',
type: 'fetch',
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'http.response.status_code': 200,
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'server.address': 'localhost',
'http.method': 'GET',
'http.scheme': 'http',
'http.request.method': 'GET',
'url.scheme': 'http',
'http.target': '/test-transaction',
'http.user_agent': 'node',
'http.flavor': '1.1',
'user_agent.original': 'node',
'client.address': '::1',
'client.port': expect.any(Number),
'network.transport': 'tcp',
Expand All @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'network.protocol.name': 'http',
'network.protocol.version': '1.1',
'server.port': 3030,
'http.status_code': 200,
'http.status_text': 'OK',
'http.response.status_text': 'OK',
'http.route': '/test-transaction',
'http.request.header.accept': '*/*',
'http.request.header.accept_encoding': 'gzip, deflate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'http.response.status_code': 200,
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'server.address': 'localhost',
'http.method': 'GET',
'http.scheme': 'http',
'http.request.method': 'GET',
'url.scheme': 'http',
'http.target': '/test-transaction',
'http.user_agent': 'node',
'http.flavor': '1.1',
'user_agent.original': 'node',
'client.address': '::1',
'client.port': expect.any(Number),
'network.transport': 'tcp',
Expand All @@ -40,8 +38,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'network.protocol.name': 'http',
'network.protocol.version': '1.1',
'server.port': 3030,
'http.status_code': 200,
'http.status_text': 'OK',
'http.response.status_text': 'OK',
'http.route': '/test-transaction',
'http.request.header.accept': '*/*',
'http.request.header.accept_encoding': 'gzip, deflate',
Expand Down
Loading
Loading