diff --git a/ssh_exporter.go b/ssh_exporter.go index 8e07e13..6ae4747 100644 --- a/ssh_exporter.go +++ b/ssh_exporter.go @@ -30,6 +30,11 @@ import ( "gopkg.in/alecthomas/kingpin.v2" ) +const ( + sshEndpoint = "/ssh" + metricsEndpoint = "/metrics" +) + var ( configFile = kingpin.Flag("config.file", "Path to exporter config file").Default("ssh_exporter.yaml").String() defaultTimeout = kingpin.Flag("collector.ssh.default-timeout", "Default timeout for SSH collection").Default("10").Int() @@ -81,7 +86,6 @@ func metricsHandler(c *config.Config, logger log.Logger) http.HandlerFunc { } func main() { - metricsEndpoint := "/ssh" promlogConfig := &promlog.Config{} flag.AddFlags(kingpin.CommandLine, promlogConfig) kingpin.Version(version.Print("ssh_exporter")) @@ -106,13 +110,13 @@ func main() { SSH Exporter

SSH Exporter

-

SSH Metrics

-

Exporter Metrics

+

SSH Metrics

+

Exporter Metrics

`)) }) - http.Handle(metricsEndpoint, metricsHandler(sc.C, logger)) - http.Handle("/metrics", promhttp.Handler()) + http.Handle(sshEndpoint, metricsHandler(sc.C, logger)) + http.Handle(metricsEndpoint, promhttp.Handler()) err := http.ListenAndServe(*listenAddress, nil) if err != nil { level.Error(logger).Log("err", err)