Skip to content

Commit f8bacc2

Browse files
committed
fix: Update span op for outgoing HTTP requests
We've established that incoming requests have op=http.server and outgoing requests have op=http.client. Specification available at: https://develop.sentry.dev/sdk/features/#http-client-integrations Last update: getsentry/develop#341
1 parent 61a22ec commit f8bacc2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/tracing/src/browser/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export function fetchCallback(
174174
type: 'fetch',
175175
},
176176
description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,
177-
op: 'http',
177+
op: 'http.client',
178178
});
179179

180180
handlerData.fetchData.__span = span.spanId;
@@ -246,7 +246,7 @@ export function xhrCallback(
246246
url: xhr.url,
247247
},
248248
description: `${xhr.method} ${xhr.url}`,
249-
op: 'http',
249+
op: 'http.client',
250250
});
251251

252252
handlerData.xhr.__sentry_xhr_span_id__ = span.spanId;

packages/tracing/test/browser/request.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe('callbacks', () => {
143143
url: 'http://dogs.are.great/',
144144
});
145145
expect(newSpan!.description).toBe('GET http://dogs.are.great/');
146-
expect(newSpan!.op).toBe('http');
146+
expect(newSpan!.op).toBe('http.client');
147147
expect(fetchHandlerData.fetchData?.__span).toBeDefined();
148148

149149
const postRequestFetchHandlerData = {
@@ -233,7 +233,7 @@ describe('callbacks', () => {
233233
url: 'http://dogs.are.great/',
234234
});
235235
expect(newSpan!.description).toBe('GET http://dogs.are.great/');
236-
expect(newSpan!.op).toBe('http');
236+
expect(newSpan!.op).toBe('http.client');
237237
expect(xhrHandlerData.xhr!.__sentry_xhr_span_id__).toBeDefined();
238238
expect(xhrHandlerData.xhr!.__sentry_xhr_span_id__).toEqual(newSpan?.spanId);
239239

0 commit comments

Comments
 (0)