Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: make max_insert_threads on dual write path configurable (#16303)

Valery Meleshkin5b0e419208a7
diff --git a/worker/src/env.ts b/worker/src/env.ts
index 25dcc5be5c..ecc061930d 100644
--- a/worker/src/env.ts
+++ b/worker/src/env.ts
@@ -369,6 +369,12 @@ const EnvSchema = z.object({
.optional()
.transform((s) => (s ? s.split(",").map((id) => id.trim()) : [])),
+ LANGFUSE_EVENT_PROPAGATION_MAX_INSERT_THREADS: z.coerce
+ .number()
+ .int()
+ .positive()
+ .default(8),
+
// Core data S3 upload - Langfuse Cloud
LANGFUSE_S3_CORE_DATA_EXPORT_IS_ENABLED: z
.enum(["true", "false"])
diff --git a/worker/src/features/eventPropagation/handleEventPropagationJob.ts b/worker/src/features/eventPropagation/handleEventPropagationJob.ts
index a65b8a714a..2eea9bc5f1 100644
--- a/worker/src/features/eventPropagation/handleEventPropagationJob.ts
+++ b/worker/src/features/eventPropagation/handleEventPropagationJob.ts
@@ -342,7 +342,9 @@ export const handleEventPropagationJob = async (
},
clickhouseSettings: {
parallel_view_processing: 1,
- max_insert_threads: "8",
+ max_insert_threads: String(
+ env.LANGFUSE_EVENT_PROPAGATION_MAX_INSERT_THREADS,
+ ),
type_json_skip_duplicated_paths: true,
},
});