mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(agent): add connection reporting for SSH and reconnecting PTY (#16652)
Updates #15139
This commit is contained in:
@@ -54,6 +54,8 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
|
||||
agentHeaderCommand string
|
||||
agentHeader []string
|
||||
devcontainersEnabled bool
|
||||
|
||||
experimentalConnectionReports bool
|
||||
)
|
||||
cmd := &serpent.Command{
|
||||
Use: "agent",
|
||||
@@ -325,6 +327,10 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
|
||||
containerLister = agentcontainers.NewDocker(execer)
|
||||
}
|
||||
|
||||
if experimentalConnectionReports {
|
||||
logger.Info(ctx, "experimental connection reports enabled")
|
||||
}
|
||||
|
||||
agnt := agent.New(agent.Options{
|
||||
Client: client,
|
||||
Logger: logger,
|
||||
@@ -353,6 +359,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
|
||||
ContainerLister: containerLister,
|
||||
|
||||
ExperimentalContainersEnabled: devcontainersEnabled,
|
||||
ExperimentalConnectionReports: experimentalConnectionReports,
|
||||
})
|
||||
|
||||
promHandler := agent.PrometheusMetricsHandler(prometheusRegistry, logger)
|
||||
@@ -482,6 +489,14 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
|
||||
Description: "Allow the agent to automatically detect running devcontainers.",
|
||||
Value: serpent.BoolOf(&devcontainersEnabled),
|
||||
},
|
||||
{
|
||||
Flag: "experimental-connection-reports-enable",
|
||||
Hidden: true,
|
||||
Default: "false",
|
||||
Env: "CODER_AGENT_EXPERIMENTAL_CONNECTION_REPORTS_ENABLE",
|
||||
Description: "Enable experimental connection reports.",
|
||||
Value: serpent.BoolOf(&experimentalConnectionReports),
|
||||
},
|
||||
}
|
||||
|
||||
return cmd
|
||||
|
||||
Reference in New Issue
Block a user