From c48c6482ecfd98d39f93ecd2a7360007df5106cb Mon Sep 17 00:00:00 2001 From: Saadi Myftija Date: Mon, 1 Dec 2025 15:30:26 +0100 Subject: [PATCH] chore(clickhouse): enable dropping run debug events Added a new env var (`EVENT_REPOSITORY_DEBUG_LOGS_DISABLED`) that allows disabling writing run debug logs in the event repository. --- apps/webapp/app/env.server.ts | 1 + apps/webapp/app/v3/eventRepository/index.server.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/apps/webapp/app/env.server.ts b/apps/webapp/app/env.server.ts index c1cf4f22ad..41dcd620a2 100644 --- a/apps/webapp/app/env.server.ts +++ b/apps/webapp/app/env.server.ts @@ -1151,6 +1151,7 @@ const EnvironmentSchema = z EVENTS_CLICKHOUSE_ASYNC_INSERT_BUSY_TIMEOUT_MS: z.coerce.number().int().default(5000), EVENT_REPOSITORY_CLICKHOUSE_ROLLOUT_PERCENT: z.coerce.number().optional(), EVENT_REPOSITORY_DEFAULT_STORE: z.enum(["postgres", "clickhouse", "clickhouse_v2"]).default("postgres"), + EVENT_REPOSITORY_DEBUG_LOGS_DISABLED: BoolEnv.default(false), EVENTS_CLICKHOUSE_MAX_TRACE_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(25_000), EVENTS_CLICKHOUSE_MAX_TRACE_DETAILED_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(5_000), EVENTS_CLICKHOUSE_MAX_LIVE_RELOADING_SETTING: z.coerce.number().int().default(2000), diff --git a/apps/webapp/app/v3/eventRepository/index.server.ts b/apps/webapp/app/v3/eventRepository/index.server.ts index e4ef0a333e..a8f66dab70 100644 --- a/apps/webapp/app/v3/eventRepository/index.server.ts +++ b/apps/webapp/app/v3/eventRepository/index.server.ts @@ -127,6 +127,13 @@ export async function recordRunDebugLog( error?: unknown; } > { + if (env.EVENT_REPOSITORY_DEBUG_LOGS_DISABLED) { + // drop debug events silently + return { + success: true, + }; + } + return recordRunEvent(runId, message, { ...options, attributes: {