Skip to content

Commit

Permalink
Add landing page to exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Primo committed Oct 23, 2019
1 parent cc8cd35 commit 3bc5b48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ha_cluster_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,21 @@ func main() {

log.Infoln("Serving metrics on port", *portNumber)
log.Infoln("refreshing metric timeouts set to", *timeoutSeconds)

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head>
<title>HACluster Exporter</title>
</head>
<body>
<h1>HACluster Exporter</h1>
<p><a href="/metrics">Metrics</a></p>
<br />
<h2>More information:</h2>
<p><a href="https://github.com/ClusterLabs/ha_cluster_exporter">github.com/ClusterLabs/ha_cluster_exporter</a></p>
</body>
</html>`))
})

log.Fatal(http.ListenAndServe(*portNumber, nil))
}

0 comments on commit 3bc5b48

Please sign in to comment.