Skip to content
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

cmd: Make a debug listen address optional #7840

Merged
merged 13 commits into from
Dec 10, 2024
Merged
2 changes: 1 addition & 1 deletion cmd/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func newAdmin(configFile string, dryRun bool) (*admin, error) {
return nil, fmt.Errorf("parsing config file: %w", err)
}

scope, logger, oTelShutdown := cmd.StatsAndLogging(c.Syslog, c.OpenTelemetry, c.Admin.DebugAddr)
scope, logger, oTelShutdown := cmd.StatsAndLogging(c.Syslog, c.OpenTelemetry, "")
defer oTelShutdown(context.Background())
logger.Info(cmd.VersionString())

Expand Down
1 change: 1 addition & 0 deletions cmd/admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Config struct {
RAService *cmd.GRPCClientConfig
SAService *cmd.GRPCClientConfig

// Deprecated: DebugAddr is no longer used.
DebugAddr string

Features features.Config
Expand Down
10 changes: 6 additions & 4 deletions cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ func newVersionCollector() prometheus.Collector {

func newStatsRegistry(addr string, logger blog.Logger) prometheus.Registerer {
registry := prometheus.NewRegistry()

if addr == "" {
logger.Info("No debug listen address specified")
return registry
}

registry.MustRegister(collectors.NewGoCollector())
registry.MustRegister(collectors.NewProcessCollector(
collectors.ProcessCollectorOpts{}))
Expand All @@ -287,10 +293,6 @@ func newStatsRegistry(addr string, logger blog.Logger) prometheus.Registerer {
ErrorLog: promLogger{logger},
}))

if addr == "" {
logger.Err("Debug listen address is not configured")
os.Exit(1)
}
logger.Infof("Debug server listening on %s", addr)

server := http.Server{
Expand Down
1 change: 0 additions & 1 deletion test/config-next/admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dbConnectFile": "test/secrets/revoker_dburl",
"maxOpenConns": 1
},
"debugAddr": ":8014",
"tls": {
"caCertFile": "test/certs/ipki/minica.pem",
"certFile": "test/certs/ipki/admin-revoker.boulder/cert.pem",
Expand Down
1 change: 0 additions & 1 deletion test/config-next/sfe.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"sfe": {
"listenAddress": "0.0.0.0:4003",
"debugAddr": ":8015",
aarongable marked this conversation as resolved.
Show resolved Hide resolved
"timeout": "30s",
"shutdownStopTimeout": "10s",
"tls": {
Expand Down
Loading