mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-02-05 22:33:44 +00:00
Remove redirect from unknown paths to /metrics
This commit is contained in:
parent
8231bc4395
commit
df954ddf9d
@ -335,7 +335,13 @@ func main() {
|
||||
http.Handle(*metricsPath, h)
|
||||
http.HandleFunc("/health", healthCheck)
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, *metricsPath, http.StatusMovedPermanently)
|
||||
_, _ = w.Write([]byte(`<html>
|
||||
<head><title>WMI Exporter</title></head>
|
||||
<body>
|
||||
<h1>WMI Exporter</h1>
|
||||
<p><a href="` + *metricsPath + `">Metrics</a></p>
|
||||
</body>
|
||||
</html>`))
|
||||
})
|
||||
|
||||
log.Infoln("Starting WMI exporter", version.Info())
|
||||
|
Loading…
Reference in New Issue
Block a user