Skip to content

Commit a4cc883

Browse files
authored
chore: add proxy health interval flag/env config (#7919)
* chore: plumbing for proxy health interval from flag/env
1 parent fa8153a commit a4cc883

File tree

10 files changed

+41
-0
lines changed

10 files changed

+41
-0
lines changed

cli/testdata/coder_server_--help.golden

+4
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ backed by Tailscale and WireGuard.
193193
The maximum lifetime duration users can specify when creating an API
194194
token.
195195

196+
--proxy-health-interval duration, $CODER_PROXY_HEALTH_INTERVAL (default: 1m0s)
197+
The interval in which coderd should be checking the status of
198+
workspace proxies.
199+
196200
--session-duration duration, $CODER_SESSION_DURATION (default: 24h0m0s)
197201
The token expiry duration for browser sessions. Sessions may last
198202
longer if they are actively making requests, but this functionality

cli/testdata/server-config.yaml.golden

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ networking:
3333
# directly in the database.
3434
# (default: <unset>, type: bool)
3535
disablePasswordAuth: false
36+
# The interval in which coderd should be checking the status of workspace proxies.
37+
# (default: 1m0s, type: duration)
38+
proxyHealthInterval: 1m0s
3639
# Configure TLS / HTTPS for your Coder deployment. If you're running
3740
# Coder behind a TLS-terminating reverse proxy or are accessing Coder over a
3841
# secure link, you can safely ignore these settings.

coderd/apidoc/docs.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/deployment.go

+11
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ type DeploymentValues struct {
163163
SSHConfig SSHConfig `json:"config_ssh,omitempty" typescript:",notnull"`
164164
WgtunnelHost clibase.String `json:"wgtunnel_host,omitempty" typescript:",notnull"`
165165
DisableOwnerWorkspaceExec clibase.Bool `json:"disable_owner_workspace_exec,omitempty" typescript:",notnull"`
166+
ProxyHealthStatusInterval clibase.Duration `json:"proxy_health_status_interval,omitempty" typescript:",notnull"`
166167

167168
Config clibase.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`
168169
WriteConfig clibase.Bool `json:"write_config,omitempty" typescript:",notnull"`
@@ -1497,6 +1498,16 @@ Write out the current server config as YAML to stdout.`,
14971498
Default: "", // empty string means pick best server
14981499
Hidden: true,
14991500
},
1501+
{
1502+
Name: "Proxy Health Check Interval",
1503+
Description: "The interval in which coderd should be checking the status of workspace proxies.",
1504+
Flag: "proxy-health-interval",
1505+
Env: "CODER_PROXY_HEALTH_INTERVAL",
1506+
Default: (time.Minute).String(),
1507+
Value: &c.ProxyHealthStatusInterval,
1508+
Group: &deploymentGroupNetworkingHTTP,
1509+
YAML: "proxyHealthInterval",
1510+
},
15001511
}
15011512
return opts
15021513
}

docs/api/general.md

+1
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
283283
"daemons": 0,
284284
"force_cancel_interval": 0
285285
},
286+
"proxy_health_status_interval": 0,
286287
"proxy_trusted_headers": ["string"],
287288
"proxy_trusted_origins": ["string"],
288289
"rate_limit": {

docs/api/schemas.md

+3
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
19471947
"daemons": 0,
19481948
"force_cancel_interval": 0
19491949
},
1950+
"proxy_health_status_interval": 0,
19501951
"proxy_trusted_headers": ["string"],
19511952
"proxy_trusted_origins": ["string"],
19521953
"rate_limit": {
@@ -2273,6 +2274,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
22732274
"daemons": 0,
22742275
"force_cancel_interval": 0
22752276
},
2277+
"proxy_health_status_interval": 0,
22762278
"proxy_trusted_headers": ["string"],
22772279
"proxy_trusted_origins": ["string"],
22782280
"rate_limit": {
@@ -2389,6 +2391,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
23892391
| `pprof` | [codersdk.PprofConfig](#codersdkpprofconfig) | false | | |
23902392
| `prometheus` | [codersdk.PrometheusConfig](#codersdkprometheusconfig) | false | | |
23912393
| `provisioner` | [codersdk.ProvisionerConfig](#codersdkprovisionerconfig) | false | | |
2394+
| `proxy_health_status_interval` | integer | false | | |
23922395
| `proxy_trusted_headers` | array of string | false | | |
23932396
| `proxy_trusted_origins` | array of string | false | | |
23942397
| `rate_limit` | [codersdk.RateLimitConfig](#codersdkratelimitconfig) | false | | |

docs/cli/server.md

+11
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,17 @@ Serve prometheus metrics on the address defined by prometheus address.
586586

587587
Number of provisioner daemons to create on start. If builds are stuck in queued state for a long time, consider increasing this.
588588

589+
### --proxy-health-interval
590+
591+
| | |
592+
| ----------- | ------------------------------------------------ |
593+
| Type | <code>duration</code> |
594+
| Environment | <code>$CODER_PROXY_HEALTH_INTERVAL</code> |
595+
| YAML | <code>networking.http.proxyHealthInterval</code> |
596+
| Default | <code>1m0s</code> |
597+
598+
The interval in which coderd should be checking the status of workspace proxies.
599+
589600
### --proxy-trusted-headers
590601

591602
| | |

enterprise/cli/server.go

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func (r *RootCmd) server() *clibase.Cmd {
6464
DERPServerRelayAddress: options.DeploymentValues.DERP.Server.RelayURL.String(),
6565
DERPServerRegionID: int(options.DeploymentValues.DERP.Server.RegionID.Value()),
6666
Options: options,
67+
ProxyHealthInterval: options.DeploymentValues.ProxyHealthStatusInterval.Value(),
6768
}
6869

6970
api, err := coderd.New(ctx, o)

site/src/api/typesGenerated.ts

+1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ export interface DeploymentValues {
368368
readonly config_ssh?: SSHConfig
369369
readonly wgtunnel_host?: string
370370
readonly disable_owner_workspace_exec?: boolean
371+
readonly proxy_health_status_interval?: number
371372
// This is likely an enum in an external package ("github.com/coder/coder/cli/clibase.YAMLConfigPath")
372373
readonly config?: string
373374
readonly write_config?: boolean

0 commit comments

Comments
 (0)