forked from mirror/client_golang
commit
9753225510
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
// // The Handler function provides a default handler to expose metrics
|
||||
// // via an HTTP server. "/metrics" is the usual endpoint for that.
|
||||
// http.Handle("/metrics", promhttp.Handler())
|
||||
// http.ListenAndServe(":8080", nil)
|
||||
// log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
// }
|
||||
//
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue