feat: add retention config for workspace_agent_logs (#21039)

Replace hardcoded 7-day retention for workspace agent logs with
configurable retention from deployment settings. Defaults to 7d to
preserve existing behavior.

Depends on #21038
Updates #20743
This commit is contained in:
Mathias Fredriksson
2025-12-02 16:01:33 +00:00
committed by GitHub
parent d9888ced11
commit ff46917e62
20 changed files with 224 additions and 45 deletions
+6
View File
@@ -717,6 +717,12 @@ that data type.
How long connection log entries are retained. Set to 0 to disable
(keep indefinitely).
--workspace-agent-logs-retention duration, $CODER_WORKSPACE_AGENT_LOGS_RETENTION (default: 7d)
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.
TELEMETRY OPTIONS:
Telemetry is critical to our ability to improve Coder. We strip all personal
information before sending data to our servers. Please only disable telemetry
+5
View File
@@ -761,3 +761,8 @@ retention:
# an expired key. Set to 0 to disable automatic deletion of expired keys.
# (default: 7d, type: duration)
api_keys: 168h0m0s
# 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.
# (default: 7d, type: duration)
workspace_agent_logs: 168h0m0s