diff --git a/plugin-server/src/utils/db/utils.ts b/plugin-server/src/utils/db/utils.ts index 7d775bd091529..a7b88a12c1ad0 100644 --- a/plugin-server/src/utils/db/utils.ts +++ b/plugin-server/src/utils/db/utils.ts @@ -39,12 +39,15 @@ export function sanitizeEventName(eventName: any): string { export function timeoutGuard( message: string, context?: Record | (() => Record), - timeout = defaultConfig.TASK_TIMEOUT * 1000 + timeout = defaultConfig.TASK_TIMEOUT * 1000, + sendToSentry = true ): NodeJS.Timeout { return setTimeout(() => { const ctx = typeof context === 'function' ? context() : context status.warn('⌛', message, ctx) - Sentry.captureMessage(message, ctx ? { extra: ctx } : undefined) + if (sendToSentry) { + Sentry.captureMessage(message, ctx ? { extra: ctx } : undefined) + } }, timeout) } diff --git a/plugin-server/src/worker/ingestion/event-pipeline/runner.ts b/plugin-server/src/worker/ingestion/event-pipeline/runner.ts index b2baa1f16e678..7d71548381b16 100644 --- a/plugin-server/src/worker/ingestion/event-pipeline/runner.ts +++ b/plugin-server/src/worker/ingestion/event-pipeline/runner.ts @@ -158,6 +158,7 @@ export class EventPipelineRunner { description: step.name, }, async () => { + const sendToSentry = false const timeout = timeoutGuard( `Event pipeline step stalled. Timeout warning after ${this.hub.PIPELINE_STEP_STALLED_LOG_TIMEOUT} sec! step=${step.name} team_id=${teamId} distinct_id=${this.originalEvent.distinct_id}`, { @@ -166,7 +167,8 @@ export class EventPipelineRunner { teamId: teamId, distinctId: this.originalEvent.distinct_id, }, - this.hub.PIPELINE_STEP_STALLED_LOG_TIMEOUT * 1000 + this.hub.PIPELINE_STEP_STALLED_LOG_TIMEOUT * 1000, + sendToSentry ) try { const result = await step(...args)