feat(coderd): add retention policy configuration#21021
Merged
Conversation
11 tasks
75a0de4 to
b5e66fa
Compare
mtojek
reviewed
Dec 1, 2025
Member
mtojek
left a comment
There was a problem hiding this comment.
wait a sec, is it only deployment config, or are you going to use these options soon? if the plan is to continue after some time, maybe park these changes in a side branch. Otherwise the commit message will be confusing.
Member
Author
mafredri
added a commit
that referenced
this pull request
Dec 1, 2025
Add configurable retention policy for audit logs. The DeleteOldAuditLogs query excludes deprecated connection events (connect, disconnect, open, close) which are handled separately by DeleteOldAuditLogConnectionEvents. Falls back to global retention if audit logs retention is unset. Disabled (0) by default. Depends on #21021 Updates #20743
mafredri
added a commit
that referenced
this pull request
Dec 1, 2025
Add configurable retention policy for audit logs. The DeleteOldAuditLogs query excludes deprecated connection events (connect, disconnect, open, close) which are handled separately by DeleteOldAuditLogConnectionEvents. Falls back to global retention if audit logs retention is unset. Disabled (0) by default. Depends on #21021 Updates #20743
dannykopping
reviewed
Dec 1, 2025
Add `RetentionConfig` with server flags for configuring data retention: - `--global-retention`: default policy for all retention settings - `--audit-logs-retention`: retention for audit log entries - `--connection-logs-retention`: retention for connection logs - `--api-keys-retention`: retention for expired API keys (default 7d) Updates #20743
b34ee61 to
d5062e2
Compare
Remove the global retention fallback in favor of explicit per-topic retention settings. This makes the retention behavior clearer and easier for operators to reason about. Each retention setting now: - Enables retention when set to a non-zero duration - Disables retention (keep indefinitely) when set to 0
mafredri
added a commit
that referenced
this pull request
Dec 2, 2025
Add configurable retention policy for audit logs. The DeleteOldAuditLogs query excludes deprecated connection events (connect, disconnect, open, close) which are handled separately by DeleteOldAuditLogConnectionEvents. Falls back to global retention if audit logs retention is unset. Disabled (0) by default. Depends on #21021 Updates #20743
dannykopping
approved these changes
Dec 2, 2025
mafredri
added a commit
that referenced
this pull request
Dec 2, 2025
Add configurable retention policy for audit logs. The DeleteOldAuditLogs query excludes deprecated connection events (connect, disconnect, open, close) which are handled separately by DeleteOldAuditLogConnectionEvents. Falls back to global retention if audit logs retention is unset. Disabled (0) by default. Depends on #21021 Updates #20743
mafredri
added a commit
that referenced
this pull request
Dec 2, 2025
Add configurable retention policy for audit logs. The DeleteOldAuditLogs query excludes deprecated connection events (connect, disconnect, open, close) which are handled separately by DeleteOldAuditLogConnectionEvents. Falls back to global retention if audit logs retention is unset. Disabled (0) by default. Depends on #21021 Updates #20743
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
RetentionConfigwith server flags for configuring data retention:--audit-logs-retention: retention for audit log entries--connection-logs-retention: retention for connection logs--api-keys-retention: retention for expired API keys (default 7d)Note: AI Bridge already has retention flags which are kept separate from
RetentionConfig, which only affects corecoderd.Updates #20743
PR Stack
workspace_agent_logs