- Notifications
You must be signed in to change notification settings - Fork1.1k
feat(coderd): add retention policy configuration#21021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
75a0de4 tob5e66faCompare
mtojek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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.
Uh oh!
There was an error while loading.Please reload this page.
mafredri commentedDec 1, 2025
mtojek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for context 👍 👍
Add configurable retention policy for audit logs. The DeleteOldAuditLogsquery 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#21021Updates#20743
Add configurable retention policy for audit logs. The DeleteOldAuditLogsquery 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#21021Updates#20743
| How long connection log entries are retained. Set to 0 to use the | ||
| global retention value, or to disable if global is also 0. | ||
| --global-retention duration, $CODER_GLOBAL_RETENTION (default: 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I feel like this is overcomplicating matters. Why do we need this? As an operator, I'd want to either use the defaults or choose retention for each topic. Having this fallback adds complexity and might make it hard for folks to reason about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It’s listed as a nice-to-have in the ticket:#20743
I do see your point as well, I could go either way here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
When it comes to irrevocably deleting data, clear and explicit > convenient every time IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Makes sense to me. Are you OK with us removing this@bpmct?
Uh oh!
There was an error while loading.Please reload this page.
Add
RetentionConfigwith 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)Note: AI Bridge already has retention flags which are kept separate from
RetentionConfig, which only affects corecoderd.Updates#20743
PR Stack
workspace_agent_logs