From 29f423ce194fc86e2b2e23e4254619b856c40b55 Mon Sep 17 00:00:00 2001 From: Brett Hoerner Date: Tue, 27 Feb 2024 12:18:23 -0700 Subject: [PATCH] chore(plugin-server): don't send event pipeline stall warnings to sentry (#20585) --- plugin-server/src/utils/db/utils.ts | 7 +++++-- .../src/worker/ingestion/event-pipeline/runner.ts | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) 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)