|
1 | 1 | import { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils'; |
2 | 2 | import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core'; |
3 | | -import { createTransport, rejectedSyncPromise } from '@sentry/core'; |
| 3 | +import { createTransport, rejectedSyncPromise, suppressTracing } from '@sentry/core'; |
4 | 4 | import type { WINDOW } from '../helpers'; |
5 | 5 | import type { BrowserTransportOptions } from './types'; |
6 | 6 |
|
@@ -45,18 +45,19 @@ 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 | | - }; |
59 | | - }); |
| 48 | + return suppressTracing(() => |
| 49 | + 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 | + }), |
| 60 | + ); |
60 | 61 | } catch (e) { |
61 | 62 | clearCachedImplementation('fetch'); |
62 | 63 | pendingBodySize -= requestSize; |
|
0 commit comments