Skip to content

feat(agent): add http debug routes for magicsock #7287

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup! feat(agent): add http debug routes for magicsock
  • Loading branch information
coadler committed Apr 25, 2023
commit 7ab75215ab6a95b77beeccbb6b9eb4e6850d3b37
8 changes: 4 additions & 4 deletions cli/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
noReap bool
sshMaxTimeout time.Duration
tailnetListenPort int64
promAddress string
prometheusAddress string
debugAddress string
)
cmd := &clibase.Cmd{
Expand Down Expand Up @@ -129,10 +129,10 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
ignorePorts[port] = "pprof"
}

prometheusSrvClose := ServeHandler(ctx, logger, prometheusMetricsHandler(), promAddress, "prometheus")
prometheusSrvClose := ServeHandler(ctx, logger, prometheusMetricsHandler(), prometheusAddress, "prometheus")
defer prometheusSrvClose()
// Do a best effort here. If this fails, it's not a big deal.
if port, err := urlPort(promAddress); err == nil {
if port, err := urlPort(prometheusAddress); err == nil {
ignorePorts[port] = "prometheus"
}

Expand Down Expand Up @@ -279,7 +279,7 @@ func (r *RootCmd) workspaceAgent() *clibase.Cmd {
Flag: "prometheus-address",
Default: "127.0.0.1:2112",
Env: "CODER_AGENT_PROMETHEUS_ADDRESS",
Value: clibase.StringOf(&promAddress),
Value: clibase.StringOf(&prometheusAddress),
Description: "The bind address to serve Prometheus metrics.",
},
{
Expand Down