mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2025-01-10 22:45:23 +00:00
add root endpoint with redirect
This commit is contained in:
parent
4270a5ed7e
commit
c4ab11d05c
1 changed files with 9 additions and 0 deletions
9
main.go
9
main.go
|
@ -34,6 +34,15 @@ var (
|
||||||
|
|
||||||
func serveHTTP() {
|
func serveHTTP() {
|
||||||
http.Handle(*metricsEndpoint, prometheus.Handler())
|
http.Handle(*metricsEndpoint, prometheus.Handler())
|
||||||
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Write([]byte(`<html>
|
||||||
|
<head><title>StatsD Bridge</title></head>
|
||||||
|
<body>
|
||||||
|
<h1>StatsD Bridge</h1>
|
||||||
|
<p><a href="` + *metricsEndpoint + `">Metrics</a></p>
|
||||||
|
</body>
|
||||||
|
</html>`))
|
||||||
|
})
|
||||||
http.ListenAndServe(*listenAddress, nil)
|
http.ListenAndServe(*listenAddress, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue