Skip to content

Commit

Permalink
Fix link to metrics path
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
  • Loading branch information
greut committed May 4, 2020
1 parent 2a584af commit 837d51e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,13 @@ func main() {
registry.MustRegister(collector.NewNginxCollector(ossClient.(*client.NginxClient), "nginx", constLabels.labels))
}
http.Handle(*metricsPath, promhttp.HandlerFor(registry, promhttp.HandlerOpts{}))

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
_, err := w.Write([]byte(`<html>
<head><title>NGINX Exporter</title></head>
<body>
_, err := fmt.Fprintf(w, `<!DOCTYPE html>
<title>NGINX Exporter</title>
<h1>NGINX Exporter</h1>
<p><a href='/metrics'>Metrics</a></p>
</body>
</html>`))
<p><a href=%q>Metrics</a></p>`,
*metricsPath)
if err != nil {
log.Printf("Error while sending a response for the '/' path: %v", err)
}
Expand Down

0 comments on commit 837d51e

Please sign in to comment.