- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: add retention config forworkspace_agent_logs#21039
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:mafredri/feat-coderd-db-retention-policy-5
Are you sure you want to change the base?
Changes fromall commits
d60e9a686363cca1bd3459ccf510File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -829,6 +829,11 @@ type RetentionConfig struct { | ||
| // Keys are only deleted if they have been expired for at least this duration. | ||
| // Defaults to 7 days to preserve existing behavior. | ||
| APIKeys serpent.Duration `json:"api_keys" typescript:",notnull"` | ||
| // WorkspaceAgentLogs controls how long workspace agent logs are retained. | ||
| // Logs are deleted if the agent hasn't connected within this period. | ||
| // Logs from the latest build are always retained regardless of age. | ||
| // Defaults to 7 days to preserve existing behavior. | ||
| WorkspaceAgentLogs serpent.Duration `json:"workspace_agent_logs" typescript:",notnull"` | ||
| } | ||
| type NotificationsConfig struct { | ||
| @@ -3420,6 +3425,17 @@ Write out the current server config as YAML to stdout.`, | ||
| YAML: "api_keys", | ||
| Annotations: serpent.Annotations{}.Mark(annotationFormatDuration, "true"), | ||
| }, | ||
| { | ||
| Name: "Workspace Agent Logs Retention", | ||
| Description: "How long workspace agent logs are retained. Logs from non-latest builds are deleted if the agent hasn't connected within this period. Logs from the latest build are always retained. Set to 0 to disable automatic deletion.", | ||
| Flag: "workspace-agent-logs-retention", | ||
| Env: "CODER_WORKSPACE_AGENT_LOGS_RETENTION", | ||
| Value: &c.Retention.WorkspaceAgentLogs, | ||
| Default: "7d", | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. What was your thought process for 7d? Is this table particularly egregious in its disk usage? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I didn't give it any thought beyond retaining existing behavior, whilst making it configurable. Actually, it's good you called this out because I noticed I need to add more color: Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. OK cool. That should be fine although I think 7d is probably a bit too short, especially if the table is not huge. Nit: MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. That was a copy paste comment from existing code, already fixed I think 7d is fine considering the constraint:
If you want to debug a build, it's quite likely that the logs will be present or old enough that you don't care. Unfortunately, the original PR did not add much motivation for the value:#6558, but given this has been the value since it's inception, I'm OK with it staying this way. | ||
| Group: &deploymentGroupRetention, | ||
| YAML: "workspace_agent_logs", | ||
| Annotations: serpent.Annotations{}.Mark(annotationFormatDuration, "true"), | ||
| }, | ||
| { | ||
| Name: "Enable Authorization Recordings", | ||
| Description: "All api requests will have a header including all authorization calls made during the request. " + | ||
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.