Skip to content

Commit b1e1c78

Browse files
committed
add method and url data at span start rather than end
1 parent e2a16ed commit b1e1c78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/tracing/src/browser/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ export function xhrCallback(
221221
if (handlerData.endTimestamp && handlerData.xhr.__sentry_xhr_span_id__) {
222222
const span = spans[handlerData.xhr.__sentry_xhr_span_id__];
223223
if (span) {
224-
span.setData('url', xhr.url);
225-
span.setData('method', xhr.method);
226224
span.setHttpStatus(xhr.status_code);
227225
span.finish();
228226

@@ -239,6 +237,8 @@ export function xhrCallback(
239237
data: {
240238
...xhr.data,
241239
type: 'xhr',
240+
method: xhr.method,
241+
url: xhr.url,
242242
},
243243
description: `${xhr.method} ${xhr.url}`,
244244
op: 'http',

0 commit comments

Comments
 (0)