diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts index 00cf0baafc6a..de6b1521d686 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/fetch/test.ts @@ -36,6 +36,13 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestPath, start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: tracingEvent.contexts?.trace?.trace_id, + data: { + 'http.method': 'GET', + 'http.url': `http://example.com/${index}`, + url: `http://example.com/${index}`, + 'server.address': 'example.com', + type: 'fetch', + }, }), ); }); diff --git a/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts b/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts index 13646a34826e..5dbfd3edf4cb 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/request/xhr/test.ts @@ -24,6 +24,13 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestPath, pa start_timestamp: expect.any(Number), timestamp: expect.any(Number), trace_id: eventData.contexts?.trace?.trace_id, + data: { + 'http.method': 'GET', + 'http.url': `http://example.com/${index}`, + url: `http://example.com/${index}`, + 'server.address': 'example.com', + type: 'xhr', + }, }), ); }); diff --git a/packages/browser/src/tracing/request.ts b/packages/browser/src/tracing/request.ts index f85282b6a8a4..d99b2cf85536 100644 --- a/packages/browser/src/tracing/request.ts +++ b/packages/browser/src/tracing/request.ts @@ -321,6 +321,7 @@ export function xhrCallback( attributes: { type: 'xhr', 'http.method': sentryXhrData.method, + 'http.url': sentryXhrData.url, url: sentryXhrData.url, 'server.address': parsedUrl.host, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.browser', diff --git a/packages/core/src/fetch.ts b/packages/core/src/fetch.ts index 784a790c25fb..8d102fac63a7 100644 --- a/packages/core/src/fetch.ts +++ b/packages/core/src/fetch.ts @@ -94,6 +94,7 @@ export function instrumentFetchRequest( url, type: 'fetch', 'http.method': method, + 'http.url': url, 'server.address': parsedUrl.host, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', diff --git a/packages/nextjs/test/integration/next.config.js b/packages/nextjs/test/integration/next.config.js.bak similarity index 100% rename from packages/nextjs/test/integration/next.config.js rename to packages/nextjs/test/integration/next.config.js.bak diff --git a/packages/nextjs/test/integration/package.json b/packages/nextjs/test/integration/package.json index f4c547b5b687..a38da23b50f8 100644 --- a/packages/nextjs/test/integration/package.json +++ b/packages/nextjs/test/integration/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@sentry/nextjs": "file:../../", - "next": "latest", + "next": "13.2.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/nextjs/test/integration/package.json.bak b/packages/nextjs/test/integration/package.json.bak new file mode 100644 index 000000000000..f4c547b5b687 --- /dev/null +++ b/packages/nextjs/test/integration/package.json.bak @@ -0,0 +1,41 @@ +{ + "name": "with-typescript", + "license": "MIT", + "scripts": { + "dev": "next", + "build": "next build", + "predebug": "source ../integration_test_utils.sh && link_monorepo_packages '../../..' && yarn build", + "start": "next start", + "pretest": "yarn build", + "test:client": "playwright test", + "test:server": "jest --forceExit --runInBand" + }, + "dependencies": { + "@sentry/nextjs": "file:../../", + "next": "latest", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/node": "^15.3.1", + "@types/react": "17.0.47", + "@types/react-dom": "17.0.17", + "nock": "^13.1.0", + "typescript": "4.9.5", + "yargs": "^16.2.0" + }, + "resolutions": { + "@sentry/browser": "file:../../../browser", + "@sentry/core": "file:../../../core", + "@sentry/node": "file:../../../node", + "@sentry/opentelemetry": "file:../../../opentelemetry", + "@sentry/react": "file:../../../react", + "@sentry-internal/browser-utils": "file:../../../browser-utils", + "@sentry-internal/replay": "file:../../../replay-internal", + "@sentry-internal/replay-canvas": "file:../../../replay-canvas", + "@sentry-internal/feedback": "file:../../../feedback", + "@sentry/types": "file:../../../types", + "@sentry/utils": "file:../../../utils", + "@sentry/vercel-edge": "file:../../../vercel-edge" + } +} diff --git a/packages/nextjs/test/integration/test/client/tracingFetch.test.ts b/packages/nextjs/test/integration/test/client/tracingFetch.test.ts index 8517b4ab0fce..395b72637354 100644 --- a/packages/nextjs/test/integration/test/client/tracingFetch.test.ts +++ b/packages/nextjs/test/integration/test/client/tracingFetch.test.ts @@ -33,6 +33,8 @@ test('should correctly instrument `fetch` for performance tracing', async ({ pag data: { 'http.method': 'GET', url: 'http://example.com', + 'http.url': 'http://example.com', + 'server.address': 'example.com', type: 'fetch', 'http.response_content_length': expect.any(Number), 'http.response.status_code': 200,