Skip to content

Commit

Permalink
Request to move from prometheus http (deprecated) to the promhttp
Browse files Browse the repository at this point in the history
  • Loading branch information
kavirajk authored and Yuri Shkuro committed May 17, 2017
1 parent e1250b0 commit 072cd1e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/addsvc/cmd/addsvc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
stdopentracing "github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
stdprometheus "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"google.golang.org/grpc"
"sourcegraph.com/sourcegraph/appdash"
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
Expand Down Expand Up @@ -198,7 +199,7 @@ func main() {
m.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
m.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
m.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
m.Handle("/metrics", stdprometheus.Handler())
m.Handle("/metrics", promhttp.Handler())

logger.Log("addr", *debugAddr)
errc <- http.ListenAndServe(*debugAddr, m)
Expand Down
3 changes: 2 additions & 1 deletion examples/shipping/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

stdprometheus "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/go-kit/kit/log"
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
Expand Down Expand Up @@ -142,7 +143,7 @@ func main() {
mux.Handle("/handling/v1/", handling.MakeHandler(hs, httpLogger))

http.Handle("/", accessControl(mux))
http.Handle("/metrics", stdprometheus.Handler())
http.Handle("/metrics", promhttp.Handler())

errs := make(chan error, 2)
go func() {
Expand Down
3 changes: 2 additions & 1 deletion examples/stringsvc2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

stdprometheus "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/go-kit/kit/log"
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
Expand Down Expand Up @@ -53,7 +54,7 @@ func main() {

http.Handle("/uppercase", uppercaseHandler)
http.Handle("/count", countHandler)
http.Handle("/metrics", stdprometheus.Handler())
http.Handle("/metrics", promhttp.Handler())
logger.Log("msg", "HTTP", "addr", ":8080")
logger.Log("err", http.ListenAndServe(":8080", nil))
}
3 changes: 2 additions & 1 deletion examples/stringsvc3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"

stdprometheus "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/go-kit/kit/log"
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
Expand Down Expand Up @@ -63,7 +64,7 @@ func main() {

http.Handle("/uppercase", uppercaseHandler)
http.Handle("/count", countHandler)
http.Handle("/metrics", stdprometheus.Handler())
http.Handle("/metrics", promhttp.Handler())
logger.Log("msg", "HTTP", "addr", *listen)
logger.Log("err", http.ListenAndServe(*listen, nil))
}

0 comments on commit 072cd1e

Please sign in to comment.