Skip to content

Commit 17f1add

Browse files
committed
Changed example sources according to the basic documentation example
1 parent 473bcd5 commit 17f1add

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

examples/random/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
"flag"
21+
"log"
2122
"math"
2223
"math/rand"
2324
"net/http"
@@ -99,5 +100,5 @@ func main() {
99100

100101
// Expose the registered metrics via HTTP.
101102
http.Handle("/metrics", prometheus.Handler())
102-
http.ListenAndServe(*addr, nil)
103+
log.Fatal(http.ListenAndServe(*addr, nil))
103104
}

examples/simple/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package main
1616

1717
import (
1818
"flag"
19+
"log"
1920
"net/http"
2021

2122
"github.com/prometheus/client_golang/prometheus"
@@ -26,5 +27,5 @@ var addr = flag.String("listen-address", ":8080", "The address to listen on for
2627
func main() {
2728
flag.Parse()
2829
http.Handle("/metrics", prometheus.Handler())
29-
http.ListenAndServe(*addr, nil)
30+
log.Fatal(http.ListenAndServe(*addr, nil))
3031
}

0 commit comments

Comments
 (0)