diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts b/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts index 1a12953fc4..4f38f48095 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts @@ -72,9 +72,14 @@ export class UserInteractionInstrumentation extends InstrumentationBase typeof config?.shouldPreventSpanCreation === 'function' ? config.shouldPreventSpanCreation : defaultShouldPreventSpanCreation; + this.init(); } - init() {} + init() { + this._eventNames.forEach(event => { + window.addEventListener(event, () => {}); + }); + } /** * This will check if last task was timeout and will save the time to