|
1 | 1 | import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core';
|
2 |
| -import { createTransport, rejectedSyncPromise } from '@sentry/core'; |
| 2 | +import { createTransport, rejectedSyncPromise, suppressTracing } from '@sentry/core'; |
3 | 3 | import { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils';
|
4 | 4 | import type { WINDOW } from '../helpers';
|
5 | 5 | import type { BrowserTransportOptions } from './types';
|
@@ -45,17 +45,18 @@ export function makeFetchTransport(
|
45 | 45 | }
|
46 | 46 |
|
47 | 47 | try {
|
48 |
| - // TODO: This may need a `suppressTracing` call in the future when we switch the browser SDK to OTEL |
49 |
| - return nativeFetch(options.url, requestOptions).then(response => { |
50 |
| - pendingBodySize -= requestSize; |
51 |
| - pendingCount--; |
52 |
| - return { |
53 |
| - statusCode: response.status, |
54 |
| - headers: { |
55 |
| - 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), |
56 |
| - 'retry-after': response.headers.get('Retry-After'), |
57 |
| - }, |
58 |
| - }; |
| 48 | + return suppressTracing(() => { |
| 49 | + return nativeFetch(options.url, requestOptions).then(response => { |
| 50 | + pendingBodySize -= requestSize; |
| 51 | + pendingCount--; |
| 52 | + return { |
| 53 | + statusCode: response.status, |
| 54 | + headers: { |
| 55 | + 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'), |
| 56 | + 'retry-after': response.headers.get('Retry-After'), |
| 57 | + }, |
| 58 | + }; |
| 59 | + }); |
59 | 60 | });
|
60 | 61 | } catch (e) {
|
61 | 62 | clearCachedImplementation('fetch');
|
|
0 commit comments