mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-28 21:51:22 +00:00
serve metrics under /metrics
This commit is contained in:
parent
5c869b5888
commit
3cdf3b670d
7
Gopkg.lock
generated
7
Gopkg.lock
generated
@ -173,7 +173,10 @@
|
|||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/prometheus/client_golang"
|
name = "github.com/prometheus/client_golang"
|
||||||
packages = ["prometheus"]
|
packages = [
|
||||||
|
"prometheus",
|
||||||
|
"prometheus/promhttp"
|
||||||
|
]
|
||||||
revision = "c5b7fccd204277076155f10851dad72b76a49317"
|
revision = "c5b7fccd204277076155f10851dad72b76a49317"
|
||||||
version = "v0.8.0"
|
version = "v0.8.0"
|
||||||
|
|
||||||
@ -423,6 +426,6 @@
|
|||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "294ac88a5b44228f5ef841b13602d0a8b8fed5fbe9b9b6df77640d636175be16"
|
inputs-digest = "3bd388e520a08cd0aa14df2d6f5ecb46449d7c36fd80cf52eb775798e6accbaa"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
@ -391,8 +391,8 @@ func (cs *ConsensusState) SetProposalAndBlock(proposal *types.Proposal, block *t
|
|||||||
// internal functions for managing the state
|
// internal functions for managing the state
|
||||||
|
|
||||||
func (cs *ConsensusState) updateHeight(height int64) {
|
func (cs *ConsensusState) updateHeight(height int64) {
|
||||||
cs.Height = height
|
|
||||||
cs.metrics.Height.Add(float64(height - cs.Height))
|
cs.metrics.Height.Add(float64(height - cs.Height))
|
||||||
|
cs.Height = height
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConsensusState) updateRoundStep(round int, step cstypes.RoundStepType) {
|
func (cs *ConsensusState) updateRoundStep(round int, step cstypes.RoundStepType) {
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
prometheus "github.com/go-kit/kit/metrics/prometheus"
|
prometheus "github.com/go-kit/kit/metrics/prometheus"
|
||||||
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
|
||||||
abci "github.com/tendermint/abci/types"
|
abci "github.com/tendermint/abci/types"
|
||||||
amino "github.com/tendermint/go-amino"
|
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 := rpcserver.NewWebsocketManager(rpccore.Routes, coreCodec, rpcserver.EventSubscriber(n.eventBus))
|
||||||
wm.SetLogger(rpcLogger.With("protocol", "websocket"))
|
wm.SetLogger(rpcLogger.With("protocol", "websocket"))
|
||||||
mux.HandleFunc("/websocket", wm.WebsocketHandler)
|
mux.HandleFunc("/websocket", wm.WebsocketHandler)
|
||||||
|
mux.Handle("/metrics", promhttp.Handler())
|
||||||
rpcserver.RegisterRPCFuncs(mux, rpccore.Routes, coreCodec, rpcLogger)
|
rpcserver.RegisterRPCFuncs(mux, rpccore.Routes, coreCodec, rpcLogger)
|
||||||
listener, err := rpcserver.StartHTTPServer(listenAddr, mux, rpcLogger)
|
listener, err := rpcserver.StartHTTPServer(listenAddr, mux, rpcLogger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user