mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-12-23 05:56:31 +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() {
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue