mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-27 14:39:53 -08:00
Allow root path as metrics path. (#2590)
Signed-off-by: LamGC <lam827@lamgc.net>
This commit is contained in:
parent
bb5ecb73d7
commit
c13f808619
|
@ -186,6 +186,7 @@ func main() {
|
||||||
level.Debug(logger).Log("msg", "Go MAXPROCS", "procs", runtime.GOMAXPROCS(0))
|
level.Debug(logger).Log("msg", "Go MAXPROCS", "procs", runtime.GOMAXPROCS(0))
|
||||||
|
|
||||||
http.Handle(*metricsPath, newHandler(!*disableExporterMetrics, *maxRequests, logger))
|
http.Handle(*metricsPath, newHandler(!*disableExporterMetrics, *maxRequests, logger))
|
||||||
|
if *metricsPath != "/" {
|
||||||
landingConfig := web.LandingConfig{
|
landingConfig := web.LandingConfig{
|
||||||
Name: "Node Exporter",
|
Name: "Node Exporter",
|
||||||
Description: "Prometheus Node Exporter",
|
Description: "Prometheus Node Exporter",
|
||||||
|
@ -203,6 +204,7 @@ func main() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
http.Handle("/", landingPage)
|
http.Handle("/", landingPage)
|
||||||
|
}
|
||||||
|
|
||||||
server := &http.Server{}
|
server := &http.Server{}
|
||||||
if err := web.ListenAndServe(server, toolkitFlags, logger); err != nil {
|
if err := web.ListenAndServe(server, toolkitFlags, logger); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue