serve metrics under /metrics

This commit is contained in:
Anton Kaliaev
2018-06-13 22:40:55 +04:00
parent 5c869b5888
commit 3cdf3b670d
3 changed files with 8 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import (
prometheus "github.com/go-kit/kit/metrics/prometheus"
stdprometheus "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
abci "github.com/tendermint/abci/types"
amino "github.com/tendermint/go-amino"
@ -532,6 +533,7 @@ func (n *Node) startRPC() ([]net.Listener, error) {
wm := rpcserver.NewWebsocketManager(rpccore.Routes, coreCodec, rpcserver.EventSubscriber(n.eventBus))
wm.SetLogger(rpcLogger.With("protocol", "websocket"))
mux.HandleFunc("/websocket", wm.WebsocketHandler)
mux.Handle("/metrics", promhttp.Handler())
rpcserver.RegisterRPCFuncs(mux, rpccore.Routes, coreCodec, rpcLogger)
listener, err := rpcserver.StartHTTPServer(listenAddr, mux, rpcLogger)
if err != nil {