Skip to content

Commit

Permalink
Merge pull request #497 from kavirajk/promhttp-depricated-changes
Browse files Browse the repository at this point in the history
Request to move from prometheus http (deprecated) to the promhttp
  • Loading branch information
peterbourgon authored Mar 12, 2017
2 parents ab50580 + 593cc9a commit b6f30a2
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 b6f30a2

Please sign in to comment.