Skip to content

Commit aed40a6

Browse files
committed
avoid breaking change
1 parent 3dd0cce commit aed40a6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/tracing/src/browser/request.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ export interface RequestInstrumentationOptions {
1919
* Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control
2020
* trace header attachment.
2121
*/
22-
tracingOrigins?: Array<string | RegExp>;
22+
tracingOrigins: Array<string | RegExp>;
2323

2424
/**
2525
* List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`
2626
* headers attached.
2727
*
2828
* Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS}
2929
*/
30-
tracePropagationTargets?: Array<string | RegExp>;
30+
tracePropagationTargets: Array<string | RegExp>;
3131

3232
/**
3333
* Flag to disable patching all together for fetch requests.
@@ -105,13 +105,17 @@ type PolymorphicRequestHeaders =
105105
export const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {
106106
traceFetch: true,
107107
traceXHR: true,
108+
// TODO (v8): Remove this property
109+
tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,
110+
tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,
108111
};
109112

110113
/** Registers span creators for xhr and fetch requests */
111114
export function instrumentOutgoingRequests(_options?: Partial<RequestInstrumentationOptions>): void {
112115
// eslint-disable-next-line deprecation/deprecation
113116
const { traceFetch, traceXHR, tracingOrigins, tracePropagationTargets, shouldCreateSpanForRequest } = {
114-
...defaultRequestInstrumentationOptions,
117+
traceFetch: defaultRequestInstrumentationOptions.traceFetch,
118+
traceXHR: defaultRequestInstrumentationOptions.traceXHR,
115119
..._options,
116120
};
117121

0 commit comments

Comments
 (0)