Skip to content

[18.0][ADD] auditlog_clickhouse_write: Add module#3528

Open
tendil wants to merge 1 commit intoOCA:18.0from
cetmix:18.0-t5246-auditlog_clickhouse-add_module
Open

[18.0][ADD] auditlog_clickhouse_write: Add module#3528
tendil wants to merge 1 commit intoOCA:18.0from
cetmix:18.0-t5246-auditlog_clickhouse-add_module

Conversation

@tendil
Copy link

@tendil tendil commented Feb 19, 2026

Purpose:
Production deployments with extensive audit rules can experience
unbounded growth of audit tables, increasing PostgreSQL bloat and
slowing down audited operations due to synchronous ORM writes. Audit
records stored in PostgreSQL are also mutable for privileged users.

This PR introduces auditlog_clickhouse_write to buffer audit payloads in
PostgreSQL and export them asynchronously to ClickHouse, enabling
scalable audit storage while reducing transactional overhead.

What’s included:

  • ClickHouse connection/configuration model and UI;
  • Local buffer model for queued audit payloads;
  • Asynchronous export via queue_job + cron trigger;
  • Tests covering buffer creation and export job behavior;
  • Documentation.

How to use:

  • Install the module, configure ClickHouse connection, test it;
  • Create tables via UI if needed;
  • Enable the configuration to start buffering and exporting.

Task: 5246

@tendil tendil marked this pull request as draft February 22, 2026 23:04
@Aldeigja Aldeigja force-pushed the 18.0-t5246-auditlog_clickhouse-add_module branch from 65ad212 to c4763c1 Compare February 23, 2026 09:38
@tendil tendil force-pushed the 18.0-t5246-auditlog_clickhouse-add_module branch 3 times, most recently from df7fdac to eed96ad Compare February 23, 2026 14:04
@tendil tendil force-pushed the 18.0-t5246-auditlog_clickhouse-add_module branch 3 times, most recently from 5ae9a83 to 5101588 Compare March 6, 2026 10:50
@tendil tendil marked this pull request as ready for review March 6, 2026 11:17
@tendil tendil force-pushed the 18.0-t5246-auditlog_clickhouse-add_module branch from 5101588 to f2e27d1 Compare March 6, 2026 11:41
@tendil tendil changed the title [18.0][ADD] auditlog_clickhouse: Add module [18.0][ADD] auditlog_clickhouse_write: Add module Mar 6, 2026
Audit tables can grow without bounds on production databases, causing
bloat and adding latency to audited operations because logs are written
synchronously in the same transaction. Keeping audit data in PostgreSQL
also leaves an immutability gap for privileged users.

Introduce a dedicated module to buffer audit payloads and export them
asynchronously to ClickHouse, allowing audit storage to scale without
slowing down business transactions and keeping audit data effectively
immutable in a write-only store.

Task: 5246
@tendil tendil force-pushed the 18.0-t5246-auditlog_clickhouse-add_module branch from f2e27d1 to 350ee69 Compare March 6, 2026 12:03
Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review LGTM

Copy link

@Aldeigja Aldeigja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants