Skip to content

Commit 1d70801

Browse files
committed
use correct url for description
1 parent 8a7ac4e commit 1d70801

File tree

3 files changed

+3
-5
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/request/xhr-strip-query-and-fragment
  • packages

3 files changed

+3
-5
lines changed

dev-packages/browser-integration-tests/suites/tracing/request/xhr-strip-query-and-fragment/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ sentryTest(
149149
const requestSpan = transactionEvent.spans?.find(({ op }) => op === 'http.client');
150150

151151
expect(requestSpan).toMatchObject({
152-
description: 'GET http://sentry-test.io/api/users',
152+
description: 'GET /api/users',
153153
parent_span_id: transactionEvent.contexts?.trace?.span_id,
154154
span_id: expect.stringMatching(/[a-f0-9]{16}/),
155155
start_timestamp: expect.any(Number),

packages/browser/src/tracing/request.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ export function xhrCallback(
349349
const fullUrl = getFullURL(url);
350350
const parsedUrl = fullUrl ? parseUrl(fullUrl) : parseUrl(url);
351351

352-
const urlForSpanName = parsedUrl ? getSanitizedUrlString(parsedUrl) : stripUrlQueryAndFragment(url);
352+
const urlForSpanName = stripUrlQueryAndFragment(url);
353353

354354
const hasParent = !!getActiveSpan();
355355

packages/core/src/fetch.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ export function instrumentFetchRequest(
5656
const fullUrl = getFullURL(url);
5757
const parsedUrl = fullUrl ? parseUrl(fullUrl) : parseUrl(url);
5858

59-
const urlForSpanName = parsedUrl ? getSanitizedUrlString(parsedUrl) : stripUrlQueryAndFragment(url);
60-
6159
const hasParent = !!getActiveSpan();
6260

6361
const span =
6462
shouldCreateSpanResult && hasParent
6563
? startInactiveSpan({
66-
name: `${method} ${urlForSpanName}`,
64+
name: `${method} ${stripUrlQueryAndFragment(url)}`,
6765
attributes: {
6866
url,
6967
type: 'fetch',

0 commit comments

Comments
 (0)