Skip to content

Commit 2f4f494

Browse files
authored
fix: Typo in constant name in @sentry/tracing (#3058)
defaultRequestInstrumentionOptions => defaultRequestInstrumentationOptions Despite being exported, the old name is not documented and not part of what is considered public API, therefore we remove the old name altogether.
1 parent d059dff commit 2f4f494

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/tracing/src/browser/browsertracing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { extractTraceparentData, secToMs } from '../utils';
99
import { registerBackgroundTabDetection } from './backgroundtab';
1010
import { MetricsInstrumentation } from './metrics';
1111
import {
12-
defaultRequestInstrumentionOptions,
12+
defaultRequestInstrumentationOptions,
1313
registerRequestInstrumentation,
1414
RequestInstrumentationOptions,
1515
} from './request';
@@ -90,7 +90,7 @@ const DEFAULT_BROWSER_TRACING_OPTIONS = {
9090
routingInstrumentation: defaultRoutingInstrumentation,
9191
startTransactionOnLocationChange: true,
9292
startTransactionOnPageLoad: true,
93-
...defaultRequestInstrumentionOptions,
93+
...defaultRequestInstrumentationOptions,
9494
};
9595

9696
/**
@@ -121,7 +121,7 @@ export class BrowserTracing implements Integration {
121121
private readonly _emitOptionsWarning: boolean = false;
122122

123123
public constructor(_options?: Partial<BrowserTracingOptions>) {
124-
let tracingOrigins = defaultRequestInstrumentionOptions.tracingOrigins;
124+
let tracingOrigins = defaultRequestInstrumentationOptions.tracingOrigins;
125125
// NOTE: Logger doesn't work in constructors, as it's initialized after integrations instances
126126
if (
127127
_options &&
@@ -152,7 +152,7 @@ export class BrowserTracing implements Integration {
152152
'[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.',
153153
);
154154
logger.warn(
155-
`[Tracing] We added a reasonable default for you: ${defaultRequestInstrumentionOptions.tracingOrigins}`,
155+
`[Tracing] We added a reasonable default for you: ${defaultRequestInstrumentationOptions.tracingOrigins}`,
156156
);
157157
}
158158

packages/tracing/src/browser/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export interface XHRData {
7676
endTimestamp?: number;
7777
}
7878

79-
export const defaultRequestInstrumentionOptions: RequestInstrumentationOptions = {
79+
export const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {
8080
traceFetch: true,
8181
traceXHR: true,
8282
tracingOrigins: DEFAULT_TRACING_ORIGINS,
@@ -86,7 +86,7 @@ export const defaultRequestInstrumentionOptions: RequestInstrumentationOptions =
8686
export function registerRequestInstrumentation(_options?: Partial<RequestInstrumentationOptions>): void {
8787
// eslint-disable-next-line @typescript-eslint/unbound-method
8888
const { traceFetch, traceXHR, tracingOrigins, shouldCreateSpanForRequest } = {
89-
...defaultRequestInstrumentionOptions,
89+
...defaultRequestInstrumentationOptions,
9090
..._options,
9191
};
9292

packages/tracing/test/browser/browsertracing.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
getHeaderContext,
1111
getMetaContent,
1212
} from '../../src/browser/browsertracing';
13-
import { defaultRequestInstrumentionOptions } from '../../src/browser/request';
13+
import { defaultRequestInstrumentationOptions } from '../../src/browser/request';
1414
import { defaultRoutingInstrumentation } from '../../src/browser/router';
1515
import * as hubExtensions from '../../src/hubextensions';
1616
import { DEFAULT_IDLE_TIMEOUT, IdleTransaction } from '../../src/idletransaction';
@@ -84,7 +84,7 @@ describe('BrowserTracing', () => {
8484
routingInstrumentation: defaultRoutingInstrumentation,
8585
startTransactionOnLocationChange: true,
8686
startTransactionOnPageLoad: true,
87-
...defaultRequestInstrumentionOptions,
87+
...defaultRequestInstrumentationOptions,
8888
});
8989
});
9090

@@ -131,7 +131,7 @@ describe('BrowserTracing', () => {
131131
});
132132

133133
expect(warnSpy).toHaveBeenCalledTimes(2);
134-
expect(inst.options.tracingOrigins).toEqual(defaultRequestInstrumentionOptions.tracingOrigins);
134+
expect(inst.options.tracingOrigins).toEqual(defaultRequestInstrumentationOptions.tracingOrigins);
135135
});
136136

137137
it('warns and uses default tracing origins if empty array given', () => {
@@ -141,7 +141,7 @@ describe('BrowserTracing', () => {
141141
});
142142

143143
expect(warnSpy).toHaveBeenCalledTimes(2);
144-
expect(inst.options.tracingOrigins).toEqual(defaultRequestInstrumentionOptions.tracingOrigins);
144+
expect(inst.options.tracingOrigins).toEqual(defaultRequestInstrumentationOptions.tracingOrigins);
145145
});
146146

147147
it('warns and uses default tracing origins if tracing origins are not defined', () => {
@@ -151,7 +151,7 @@ describe('BrowserTracing', () => {
151151
});
152152

153153
expect(warnSpy).toHaveBeenCalledTimes(2);
154-
expect(inst.options.tracingOrigins).toEqual(defaultRequestInstrumentionOptions.tracingOrigins);
154+
expect(inst.options.tracingOrigins).toEqual(defaultRequestInstrumentationOptions.tracingOrigins);
155155
});
156156

157157
it('sets tracing origins if provided and does not warn', () => {

0 commit comments

Comments
 (0)