Skip to content

Add opt-in data_length to write audit logs - #170

Merged
arkmish merged 2 commits into
branch-3.6from
armishra/audit-data-length
Oct 26, 2026
Merged

arkmish merged 2 commits into
branch-3.6from
armishra/audit-data-length

Conversation

@arkmish

@arkmish arkmish commented Oct 26, 2026

Copy link
Copy Markdown

Description

Adds a data_length field (payload size in bytes) to audit records for create variants and setData, including failed requests and members of successful multis. Null/empty data is 0. Payloads are never logged.

Gated by zookeeper.audit.dataLength.enable (or audit.dataLength.enable in zoo.cfg), default false, read at startup and effective only when zookeeper.audit.enable=true. With the flag off, audit output is unchanged.

This is the data_length-only subset of #152.

Tests

  • New AuditDataLengthTest: create/setData, empty data, failed writes, multi with a check op.
  • StandaloneServerAuditTest (flag off) unchanged and passing.
  • checkstyle + spotbugs pass.

🤖 Generated with GitHub Copilot CLI

Log the payload size of create and setData requests (including failed
requests and members of successful multis) as data_length when
zookeeper.audit.dataLength.enable=true. Disabled by default; existing
audit output is unchanged when off.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arkmish
arkmish merged commit 9d24593 into branch-3.6 Oct 26, 2026
20 checks passed
@arkmish
arkmish deleted the armishra/audit-data-length branch October 26, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants