feat(webapp): add option to disable PostgreSQL task-event writes#4242
feat(webapp): add option to disable PostgreSQL task-event writes#4242ericallam wants to merge 3 commits into
Conversation
Adds EVENT_REPOSITORY_POSTGRES_WRITES_DISABLED (default off). When enabled, the task-event store skips all PostgreSQL writes, for deployments that store task events in ClickHouse (EVENT_REPOSITORY_DEFAULT_STORE=clickhouse_v2). Reads are unaffected, so existing events stay readable.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (8)
WalkthroughAdds the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ository entry points Guarding at TaskEventStore.createMany stopped the write but the repository still buffered, reported success, and published Redis notifications for events that were never persisted. Move the check to the insertMany/insertImmediate/ insertManyImmediate entry points so the postgres store is fully inert when writes are disabled.
…rtMany The postgres-writes-disabled guard was bypassed: recordEvent and traceEvent fed the flush scheduler directly for non-immediate events, so they still wrote to PostgreSQL with the flag on. Route both through the guarded insertMany, making it the only feeder of the flush scheduler.
Summary
Adds
EVENT_REPOSITORY_POSTGRES_WRITES_DISABLED(default off), which makes the task-event store skip all PostgreSQLTaskEventwrites. It's for deployments that store task events in ClickHouse (EVENT_REPOSITORY_DEFAULT_STORE=clickhouse_v2) and no longer want the PostgreSQL copy.How it works
The guard sits at the single postgres write boundary,
TaskEventStore.create/createMany, so it covers every write path (OTLP ingestion and run-lifecycle events) with one check. Reads are untouched (findMany/ trace queries / streaming), so existing PostgreSQL events remain readable.Leave it off unless the default store is
clickhouse_v2, otherwise task events for any run still routed to PostgreSQL would be dropped.