ncabatoff / process-exporter

Prometheus exporter that mines /proc to report on selected processes
MIT License
1.72k stars 270 forks source link

Failed to start the server: no web listen address or systemd socket flag specified #294

Closed AiDaiP closed 7 months ago

AiDaiP commented 7 months ago

Hello, I got an error when using the latest version of process-exporter:

./process-exporter
Failed to start the server: no web listen address or systemd socket flag specified

The default value of -web.listen-address is :9256, however, this parameter does not seem to be passed in correctly, and even if I explicitly specify it on the command line, this error still occurs. The location where I observed the error return is

// go/pkg/mod/github.com/prometheus/exporter-toolkit@v0.11.0/web/tls_config.go
func ListenAndServe(server *http.Server, flags *FlagConfig, logger log.Logger) error {
if flags.WebSystemdSocket == nil && (flags.WebListenAddresses == nil || len(*flags.WebListenAddresses) == 0) {
return ErrNoListeners
}

flags are specified in process-exporter/cmd/process-exporter/main.go

if err := web.ListenAndServe(server, &web.FlagConfig{
WebConfigFile: tlsConfigFile,
}, logger); err != nil {
log.Fatalf("Failed to start the server: %v", err)
os.Exit(1)
}

Only WebConfigFile is set here, but WebListenAddresses is not set. WebListenAddresses is empty by default, so this error is triggered.

fuster92 commented 7 months ago

Same error observed after using 0.7.11, reverting to 0.7.10 fixes the issue.