Merge pull request #251 from Comradin/master

Documentation enhancement
This commit is contained in:
Björn Rabenstein 2016-11-02 11:23:09 +01:00 committed by GitHub
commit 9753225510
3 changed files with 5 additions and 3 deletions

View File

@ -18,6 +18,7 @@ package main
import ( import (
"flag" "flag"
"log"
"math" "math"
"math/rand" "math/rand"
"net/http" "net/http"
@ -99,5 +100,5 @@ func main() {
// Expose the registered metrics via HTTP. // Expose the registered metrics via HTTP.
http.Handle("/metrics", prometheus.Handler()) http.Handle("/metrics", prometheus.Handler())
http.ListenAndServe(*addr, nil) log.Fatal(http.ListenAndServe(*addr, nil))
} }

View File

@ -16,6 +16,7 @@ package main
import ( import (
"flag" "flag"
"log"
"net/http" "net/http"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
@ -26,5 +27,5 @@ var addr = flag.String("listen-address", ":8080", "The address to listen on for
func main() { func main() {
flag.Parse() flag.Parse()
http.Handle("/metrics", prometheus.Handler()) http.Handle("/metrics", prometheus.Handler())
http.ListenAndServe(*addr, nil) log.Fatal(http.ListenAndServe(*addr, nil))
} }

View File

@ -59,7 +59,7 @@
// // The Handler function provides a default handler to expose metrics // // The Handler function provides a default handler to expose metrics
// // via an HTTP server. "/metrics" is the usual endpoint for that. // // via an HTTP server. "/metrics" is the usual endpoint for that.
// http.Handle("/metrics", promhttp.Handler()) // http.Handle("/metrics", promhttp.Handler())
// http.ListenAndServe(":8080", nil) // log.Fatal(http.ListenAndServe(":8080", nil))
// } // }
// //
// //