mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-27 15:16:35 +00:00
Remove redirect from unknown paths to /metrics
This commit is contained in:
@@ -335,7 +335,13 @@ func main() {
|
|||||||
http.Handle(*metricsPath, h)
|
http.Handle(*metricsPath, h)
|
||||||
http.HandleFunc("/health", healthCheck)
|
http.HandleFunc("/health", healthCheck)
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
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())
|
log.Infoln("Starting WMI exporter", version.Info())
|
||||||
|
|||||||
Reference in New Issue
Block a user