Skip to content

feat: add archiveInterval, archiveGracePeriod, and archiveMaxObjectBytes audit log archival config options - #5229

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage
Jul 17, 2026
Merged

feat: add archiveInterval, archiveGracePeriod, and archiveMaxObjectBytes audit log archival config options#5229
Pratham-Mishra04 merged 1 commit into
devfrom
07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage

Conversation

@impoiler

@impoiler impoiler commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds three new tunable parameters for audit log archival to object storage: archive_interval, archive_grace_period, and archive_max_object_bytes. These allow operators to control the archival window size, how long a window stays open past its end to absorb late inserts, and the maximum uncompressed size of each part object before rolling to a new one.

Changes

  • Added archive_interval (default 24h, minimum 5m) to control the archival window size and background job period. Each closed window is written as a set of objects to object storage.
  • Added archive_grace_period (default 15m) to hold a window open past its end before archiving, absorbing clock skew and late inserts. Must be less than archive_interval.
  • Added archive_max_object_bytes (default 128MiB, range 1MiB–4GiB) to roll a new part object once the current part reaches the specified uncompressed byte threshold. Peak memory on the archiving node is roughly 2x this value when compression is enabled.
  • Updated the object storage description to reflect the new windowed archival model: a background job writes each closed window as one or more JSONL part objects plus a manifest at {prefix}/audit-logs/YYYY/MM/DD/{start}-{end}/. The manifest is the authoritative index for a window; any object not listed in it should be ignored.
  • Updated values.yaml comments to document the new parameters and clarify archival behavior (no backfill, no row deletion, leader-only in a cluster).

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Deploy bifrost with objectStorage configured and set non-default values for the new parameters:

bifrost:
  auditLogs:
    archiveInterval: "1h"
    archiveGracePeriod: "5m"
    archiveMaxObjectBytes: 10485760  # 10MiB
    objectStorage:
      type: s3
      bucket: my-bucket

Verify that:

  • Audit events are archived into windowed paths (YYYY/MM/DD/{start}-{end}/part-00000.jsonl[.gz]) rather than the old per-batch path.
  • A manifest.json[.gz] is written alongside each set of part objects.
  • Windows only close after archiveGracePeriod has elapsed past the window end.
  • Part objects roll over once they reach archiveMaxObjectBytes uncompressed bytes.
go test ./...

New config parameters:

Parameter Default Description
archive_interval / archiveInterval 24h Archival window size and job period (minimum 5m)
archive_grace_period / archiveGracePeriod 15m Grace period past window end before archiving; must be less than archive_interval
archive_max_object_bytes / archiveMaxObjectBytes 134217728 (128MiB) Max uncompressed bytes per part object before rolling; clamped to [1MiB, 4GiB]

Breaking changes

  • Yes
  • No

Security considerations

archive_max_object_bytes directly influences peak memory consumption on the archiving node (roughly 2x the value when compression is enabled). Operators should size pod memory limits accordingly to avoid OOM conditions when tuning this value upward.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 46f5b6a7-9422-4fdc-be8c-81cc1dde98d2

📥 Commits

Reviewing files that changed from the base of the PR and between 78dadcf and 6b4a3f9.

📒 Files selected for processing (4)
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml
  • transports/config.schema.json
📝 Walkthrough

Walkthrough

Adds audit-log archival tuning fields for interval, grace period, and maximum object size across transport and Helm schemas, wires optional Helm values into generated configuration, and updates object-storage archival documentation to describe windowed JSONL parts and manifests.

Changes

Audit archival configuration

Layer / File(s) Summary
Archival configuration contract
transports/config.schema.json, helm-charts/bifrost/values.schema.json
Adds validated archival tuning fields with defaults and updates object-storage descriptions for windowed archival, JSONL parts, manifests, and cluster coordination.
Helm configuration propagation
helm-charts/bifrost/templates/_helpers.tpl, helm-charts/bifrost/values.yaml
Passes optional archival settings into generated audit-log configuration and documents their windowing and storage behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • maximhq/bifrost#4991: Adds the underlying transport object-storage audit-log configuration extended by this PR.
  • maximhq/bifrost#4992: Documents the prior audit-log object-storage archival behavior updated by this PR.
  • maximhq/bifrost#5077: Adds the Helm object-storage support extended with archival tuning fields here.

Suggested reviewers: akshaydeo, tejasghatte, danpiths

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the new audit log archival config options and matches the changeset.
Description check ✅ Passed The description follows the template well with summary, changes, testing, security, and checklist sections filled in.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage

Comment @coderabbitai help to get the list of available commands.

impoiler commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@impoiler impoiler changed the title feat: allow time interval and size flexibility in audit logs in object storage feat: add archiveInterval, archiveGracePeriod, and archiveMaxObjectBytes audit log archival config options Jul 15, 2026
@impoiler impoiler self-assigned this Jul 15, 2026
@impoiler
impoiler marked this pull request as ready for review July 15, 2026 06:33
@impoiler
impoiler requested a review from a team as a code owner July 15, 2026 06:33
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This looks safe to merge.

  • The latest changes resolve the validation and documentation mismatch for object-size bounds.
  • Helm and direct configuration paths now describe the same strict range.
  • No blocking issue remains in the changed code.

Important Files Changed

Filename Overview
transports/config.schema.json Adds the authoritative archival fields and clearly defines strict object-size validation.
helm-charts/bifrost/values.schema.json Adds matching Helm schema fields, defaults, duration formats, and size bounds.
helm-charts/bifrost/templates/_helpers.tpl Maps the new Helm values to their snake_case runtime configuration keys.
helm-charts/bifrost/values.yaml Documents the windowed archival model and the new configuration options.

Reviews (4): Last reviewed commit: "feat: allow time interval and size flexi..." | Re-trigger Greptile

Comment thread transports/config.schema.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@transports/config.schema.json`:
- Around line 5789-5799: Update the duration regex patterns for archive_interval
and archive_grace_period in transports/config.schema.json at lines 5789-5799 to
accept both “us” and “µs” units. Apply the same pattern changes to the
corresponding fields in helm-charts/bifrost/values.schema.json at lines
3519-3529, preserving all existing duration formats.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 601b21d7-692b-4529-81e5-26ee208c5a25

📥 Commits

Reviewing files that changed from the base of the PR and between c0909f9 and d6008e8.

📒 Files selected for processing (4)
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml
  • transports/config.schema.json

Comment thread transports/config.schema.json
@impoiler
impoiler force-pushed the 07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage branch from d6008e8 to 78dadcf Compare July 15, 2026 08:34
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026
@impoiler
impoiler changed the base branch from dev to graphite-base/5229 July 16, 2026 06:08
@impoiler
impoiler force-pushed the 07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage branch from 78dadcf to c0ea503 Compare July 16, 2026 06:08
@impoiler
impoiler force-pushed the graphite-base/5229 branch from c0909f9 to b3b430c Compare July 16, 2026 06:08
@impoiler
impoiler changed the base branch from graphite-base/5229 to 07-15-fix_tool_sync_interval_bug_fix_backend July 16, 2026 06:08
@impoiler
impoiler force-pushed the 07-15-fix_tool_sync_interval_bug_fix_backend branch from b3b430c to c326247 Compare July 16, 2026 06:09

Pratham-Mishra04 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • Jul 17, 11:05 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 17, 11:41 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 17, 11:42 AM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 07-15-fix_tool_sync_interval_bug_fix_backend to graphite-base/5229 July 17, 2026 11:36
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/5229 to dev July 17, 2026 11:40
@Pratham-Mishra04
Pratham-Mishra04 dismissed coderabbitai[bot]’s stale review July 17, 2026 11:40

The base branch was changed.

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage branch from a6e8d94 to 6b4a3f9 Compare July 17, 2026 11:40
@Pratham-Mishra04
Pratham-Mishra04 merged commit 7a6157a into dev Jul 17, 2026
14 of 15 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 07-15-feat_allow_time_interval_and_size_flexibility_in_audit_logs_in_object_storage branch July 17, 2026 11:42
akshaydeo pushed a commit that referenced this pull request Jul 17, 2026
…ectBytes` audit log archival config options (#5229)

## Summary

Adds three new tunable parameters for audit log archival to object storage: `archive_interval`, `archive_grace_period`, and `archive_max_object_bytes`. These allow operators to control the archival window size, how long a window stays open past its end to absorb late inserts, and the maximum uncompressed size of each part object before rolling to a new one.

## Changes

- Added `archive_interval` (default `24h`, minimum `5m`) to control the archival window size and background job period. Each closed window is written as a set of objects to object storage.
- Added `archive_grace_period` (default `15m`) to hold a window open past its end before archiving, absorbing clock skew and late inserts. Must be less than `archive_interval`.
- Added `archive_max_object_bytes` (default `128MiB`, range `1MiB–4GiB`) to roll a new part object once the current part reaches the specified uncompressed byte threshold. Peak memory on the archiving node is roughly 2x this value when compression is enabled.
- Updated the object storage description to reflect the new windowed archival model: a background job writes each closed window as one or more JSONL part objects plus a manifest at `{prefix}/audit-logs/YYYY/MM/DD/{start}-{end}/`. The manifest is the authoritative index for a window; any object not listed in it should be ignored.
- Updated `values.yaml` comments to document the new parameters and clarify archival behavior (no backfill, no row deletion, leader-only in a cluster).

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Deploy bifrost with `objectStorage` configured and set non-default values for the new parameters:

```yaml
bifrost:
  auditLogs:
    archiveInterval: "1h"
    archiveGracePeriod: "5m"
    archiveMaxObjectBytes: 10485760  # 10MiB
    objectStorage:
      type: s3
      bucket: my-bucket
```

Verify that:
- Audit events are archived into windowed paths (`YYYY/MM/DD/{start}-{end}/part-00000.jsonl[.gz]`) rather than the old per-batch path.
- A `manifest.json[.gz]` is written alongside each set of part objects.
- Windows only close after `archiveGracePeriod` has elapsed past the window end.
- Part objects roll over once they reach `archiveMaxObjectBytes` uncompressed bytes.

```sh
go test ./...
```

**New config parameters:**

| Parameter | Default | Description |
|---|---|---|
| `archive_interval` / `archiveInterval` | `24h` | Archival window size and job period (minimum `5m`) |
| `archive_grace_period` / `archiveGracePeriod` | `15m` | Grace period past window end before archiving; must be less than `archive_interval` |
| `archive_max_object_bytes` / `archiveMaxObjectBytes` | `134217728` (128MiB) | Max uncompressed bytes per part object before rolling; clamped to `[1MiB, 4GiB]` |

## Breaking changes

- [ ] Yes
- [x] No

## Security considerations

`archive_max_object_bytes` directly influences peak memory consumption on the archiving node (roughly 2x the value when compression is enabled). Operators should size pod memory limits accordingly to avoid OOM conditions when tuning this value upward.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo pushed a commit that referenced this pull request Jul 18, 2026
…ectBytes` audit log archival config options (#5229)

## Summary

Adds three new tunable parameters for audit log archival to object storage: `archive_interval`, `archive_grace_period`, and `archive_max_object_bytes`. These allow operators to control the archival window size, how long a window stays open past its end to absorb late inserts, and the maximum uncompressed size of each part object before rolling to a new one.

## Changes

- Added `archive_interval` (default `24h`, minimum `5m`) to control the archival window size and background job period. Each closed window is written as a set of objects to object storage.
- Added `archive_grace_period` (default `15m`) to hold a window open past its end before archiving, absorbing clock skew and late inserts. Must be less than `archive_interval`.
- Added `archive_max_object_bytes` (default `128MiB`, range `1MiB–4GiB`) to roll a new part object once the current part reaches the specified uncompressed byte threshold. Peak memory on the archiving node is roughly 2x this value when compression is enabled.
- Updated the object storage description to reflect the new windowed archival model: a background job writes each closed window as one or more JSONL part objects plus a manifest at `{prefix}/audit-logs/YYYY/MM/DD/{start}-{end}/`. The manifest is the authoritative index for a window; any object not listed in it should be ignored.
- Updated `values.yaml` comments to document the new parameters and clarify archival behavior (no backfill, no row deletion, leader-only in a cluster).

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Deploy bifrost with `objectStorage` configured and set non-default values for the new parameters:

```yaml
bifrost:
  auditLogs:
    archiveInterval: "1h"
    archiveGracePeriod: "5m"
    archiveMaxObjectBytes: 10485760  # 10MiB
    objectStorage:
      type: s3
      bucket: my-bucket
```

Verify that:
- Audit events are archived into windowed paths (`YYYY/MM/DD/{start}-{end}/part-00000.jsonl[.gz]`) rather than the old per-batch path.
- A `manifest.json[.gz]` is written alongside each set of part objects.
- Windows only close after `archiveGracePeriod` has elapsed past the window end.
- Part objects roll over once they reach `archiveMaxObjectBytes` uncompressed bytes.

```sh
go test ./...
```

**New config parameters:**

| Parameter | Default | Description |
|---|---|---|
| `archive_interval` / `archiveInterval` | `24h` | Archival window size and job period (minimum `5m`) |
| `archive_grace_period` / `archiveGracePeriod` | `15m` | Grace period past window end before archiving; must be less than `archive_interval` |
| `archive_max_object_bytes` / `archiveMaxObjectBytes` | `134217728` (128MiB) | Max uncompressed bytes per part object before rolling; clamped to `[1MiB, 4GiB]` |

## Breaking changes

- [ ] Yes
- [x] No

## Security considerations

`archive_max_object_bytes` directly influences peak memory consumption on the archiving node (roughly 2x the value when compression is enabled). Operators should size pod memory limits accordingly to avoid OOM conditions when tuning this value upward.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
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