Skip to content

Commit 6ae1317

Browse files
authored
chore(clickhouse): enable dropping run debug events (#2720)
Added a new env var (`EVENT_REPOSITORY_DEBUG_LOGS_DISABLED`) that allows disabling writing run debug logs in the event repository.
1 parent 2e1c4f6 commit 6ae1317

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

apps/webapp/app/env.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@ const EnvironmentSchema = z
11511151
EVENTS_CLICKHOUSE_ASYNC_INSERT_BUSY_TIMEOUT_MS: z.coerce.number().int().default(5000),
11521152
EVENT_REPOSITORY_CLICKHOUSE_ROLLOUT_PERCENT: z.coerce.number().optional(),
11531153
EVENT_REPOSITORY_DEFAULT_STORE: z.enum(["postgres", "clickhouse", "clickhouse_v2"]).default("postgres"),
1154+
EVENT_REPOSITORY_DEBUG_LOGS_DISABLED: BoolEnv.default(false),
11541155
EVENTS_CLICKHOUSE_MAX_TRACE_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(25_000),
11551156
EVENTS_CLICKHOUSE_MAX_TRACE_DETAILED_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(5_000),
11561157
EVENTS_CLICKHOUSE_MAX_LIVE_RELOADING_SETTING: z.coerce.number().int().default(2000),

apps/webapp/app/v3/eventRepository/index.server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ export async function recordRunDebugLog(
127127
error?: unknown;
128128
}
129129
> {
130+
if (env.EVENT_REPOSITORY_DEBUG_LOGS_DISABLED) {
131+
// drop debug events silently
132+
return {
133+
success: true,
134+
};
135+
}
136+
130137
return recordRunEvent(runId, message, {
131138
...options,
132139
attributes: {

0 commit comments

Comments
 (0)