Changed example sources according to the basic documentation example

This commit is contained in:
Marcus Franke 2016-11-02 10:52:31 +01:00
parent 473bcd5aa1
commit 17f1add33c
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -16,6 +16,7 @@ package main
import (
"flag"
"log"
"net/http"
"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() {
flag.Parse()
http.Handle("/metrics", prometheus.Handler())
http.ListenAndServe(*addr, nil)
log.Fatal(http.ListenAndServe(*addr, nil))
}