Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cli/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func workspaceAgent() *serpent.Command {
devcontainerDiscoveryAutostart bool
socketServerEnabled bool
socketPath string
reportMetadataInterval time.Duration
)
agentAuth := &AgentAuth{}
cmd := &serpent.Command{
Expand Down Expand Up @@ -319,8 +320,9 @@ func workspaceAgent() *serpent.Command {
agentcontainers.WithProjectDiscovery(devcontainerProjectDiscovery),
agentcontainers.WithDiscoveryAutostart(devcontainerDiscoveryAutostart),
},
SocketPath: socketPath,
SocketServerEnabled: socketServerEnabled,
SocketPath: socketPath,
SocketServerEnabled: socketServerEnabled,
ReportMetadataInterval: reportMetadataInterval,
})

if debugAddress != "" {
Expand Down Expand Up @@ -494,6 +496,13 @@ func workspaceAgent() *serpent.Command {
Description: "Specify the path for the agent socket.",
Value: serpent.StringOf(&socketPath),
},
{
Flag: "report-metadata-interval",
Default: "1s",
Env: "CODER_AGENT_REPORT_METADATA_INTERVAL",
Description: "The interval at which the agent reports metadata to the Coder server. Lower values result in more frequent updates but higher database load.",
Value: serpent.DurationOf(&reportMetadataInterval),
},
}
agentAuth.AttachOptions(cmd, false)
return cmd
Expand Down
4 changes: 4 additions & 0 deletions cli/testdata/coder_agent_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ OPTIONS:
--prometheus-address string, $CODER_AGENT_PROMETHEUS_ADDRESS (default: 127.0.0.1:2112)
The bind address to serve Prometheus metrics.

--report-metadata-interval duration, $CODER_AGENT_REPORT_METADATA_INTERVAL (default: 1s)
The interval at which the agent reports metadata to the Coder server.
Lower values result in more frequent updates but higher database load.

--script-data-dir string, $CODER_AGENT_SCRIPT_DATA_DIR (default: /tmp)
Specify the location for storing script data.

Expand Down
Loading