Skip to content

Commit b34bae9

Browse files
committed
Switch away from rate to bool
1 parent d34b741 commit b34bae9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

packages/tracing/src/browser/browsertracing.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export interface BrowserTracingOptions extends RequestInstrumentationOptions {
9292
*
9393
* Default: undefined
9494
*/
95-
_experiments?: Partial<{ enableLongTask: boolean; interactionSampleRate: number }>;
95+
_experiments?: Partial<{ enableLongTask: boolean; enableInteractions: boolean }>;
9696

9797
/**
9898
* beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction
@@ -125,7 +125,7 @@ const DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {
125125
routingInstrumentation: instrumentRoutingWithDefaults,
126126
startTransactionOnLocationChange: true,
127127
startTransactionOnPageLoad: true,
128-
_experiments: { enableLongTask: true, interactionSampleRate: 0.0 },
128+
_experiments: { enableLongTask: true, enableInteractions: false },
129129
...defaultRequestInstrumentationOptions,
130130
};
131131

@@ -206,8 +206,8 @@ export class BrowserTracing implements Integration {
206206
registerBackgroundTabDetection();
207207
}
208208

209-
if (_experiments?.interactionSampleRate ?? 0 > 0) {
210-
this._registerInteractionListener(_experiments?.interactionSampleRate ?? 0);
209+
if (_experiments?.enableInteractions) {
210+
this._registerInteractionListener();
211211
}
212212

213213
instrumentOutgoingRequests({
@@ -291,13 +291,10 @@ export class BrowserTracing implements Integration {
291291
}
292292

293293
/** Start listener for interaction transactions */
294-
private _registerInteractionListener(interactionSampleRate: number): void {
294+
private _registerInteractionListener(): void {
295295
let inflightInteractionTransaction: IdleTransaction | undefined;
296296
const registerInteractionTransaction = (): void => {
297297
const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;
298-
if (Math.random() > interactionSampleRate) {
299-
return;
300-
}
301298

302299
const op = 'ui.action.click';
303300
if (inflightInteractionTransaction) {

0 commit comments

Comments
 (0)