Request to move from prometheus http (deprecated) to the promhttp
fixes #491
Kaviraj
6 years ago
16 | 16 |
stdopentracing "github.com/opentracing/opentracing-go"
|
17 | 17 |
zipkin "github.com/openzipkin/zipkin-go-opentracing"
|
18 | 18 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
|
19 |
"github.com/prometheus/client_golang/prometheus/promhttp"
|
19 | 20 |
"google.golang.org/grpc"
|
20 | 21 |
"sourcegraph.com/sourcegraph/appdash"
|
21 | 22 |
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
|
|
197 | 198 |
m.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
|
198 | 199 |
m.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
|
199 | 200 |
m.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
|
200 | |
m.Handle("/metrics", stdprometheus.Handler())
|
|
201 |
m.Handle("/metrics", promhttp.Handler())
|
201 | 202 |
|
202 | 203 |
logger.Log("addr", *debugAddr)
|
203 | 204 |
errc <- http.ListenAndServe(*debugAddr, m)
|
11 | 11 |
"time"
|
12 | 12 |
|
13 | 13 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
|
14 |
"github.com/prometheus/client_golang/prometheus/promhttp"
|
14 | 15 |
|
15 | 16 |
"github.com/go-kit/kit/log"
|
16 | 17 |
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
|
|
141 | 142 |
mux.Handle("/handling/v1/", handling.MakeHandler(hs, httpLogger))
|
142 | 143 |
|
143 | 144 |
http.Handle("/", accessControl(mux))
|
144 | |
http.Handle("/metrics", stdprometheus.Handler())
|
|
145 |
http.Handle("/metrics", promhttp.Handler())
|
145 | 146 |
|
146 | 147 |
errs := make(chan error, 2)
|
147 | 148 |
go func() {
|
4 | 4 |
"os"
|
5 | 5 |
|
6 | 6 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
|
7 |
"github.com/prometheus/client_golang/prometheus/promhttp"
|
7 | 8 |
|
8 | 9 |
"github.com/go-kit/kit/log"
|
9 | 10 |
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
|
|
52 | 53 |
|
53 | 54 |
http.Handle("/uppercase", uppercaseHandler)
|
54 | 55 |
http.Handle("/count", countHandler)
|
55 | |
http.Handle("/metrics", stdprometheus.Handler())
|
|
56 |
http.Handle("/metrics", promhttp.Handler())
|
56 | 57 |
logger.Log("msg", "HTTP", "addr", ":8080")
|
57 | 58 |
logger.Log("err", http.ListenAndServe(":8080", nil))
|
58 | 59 |
}
|
6 | 6 |
"os"
|
7 | 7 |
|
8 | 8 |
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
|
9 |
"github.com/prometheus/client_golang/prometheus/promhttp"
|
9 | 10 |
|
10 | 11 |
"github.com/go-kit/kit/log"
|
11 | 12 |
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
|
|
62 | 63 |
|
63 | 64 |
http.Handle("/uppercase", uppercaseHandler)
|
64 | 65 |
http.Handle("/count", countHandler)
|
65 | |
http.Handle("/metrics", stdprometheus.Handler())
|
|
66 |
http.Handle("/metrics", promhttp.Handler())
|
66 | 67 |
logger.Log("msg", "HTTP", "addr", *listen)
|
67 | 68 |
logger.Log("err", http.ListenAndServe(*listen, nil))
|
68 | 69 |
}
|