mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-10 05:50:19 +00:00
internal/proxy: add initial set of abci metrics
This commit is contained in:
10
node/node.go
10
node/node.go
@@ -146,8 +146,10 @@ func makeNode(cfg *config.Config,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
nodeMetrics := defaultMetricsProvider(cfg.Instrumentation)(genDoc.ChainID)
|
||||
|
||||
// Create the proxyApp and establish connections to the ABCI app (consensus, mempool, query).
|
||||
proxyApp, err := createAndStartProxyAppConns(clientCreator, logger)
|
||||
proxyApp, err := createAndStartProxyAppConns(clientCreator, logger, nodeMetrics.proxy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -240,9 +242,6 @@ func makeNode(cfg *config.Config,
|
||||
return nil, fmt.Errorf("failed to create peer manager: %w", err)
|
||||
}
|
||||
|
||||
nodeMetrics :=
|
||||
defaultMetricsProvider(cfg.Instrumentation)(genDoc.ChainID)
|
||||
|
||||
router, err := createRouter(p2pLogger, nodeMetrics.p2p, nodeInfo, nodeKey.PrivKey,
|
||||
peerManager, transport, getRouterConfig(cfg, proxyApp))
|
||||
if err != nil {
|
||||
@@ -928,6 +927,7 @@ type nodeMetrics struct {
|
||||
mempool *mempool.Metrics
|
||||
state *sm.Metrics
|
||||
statesync *statesync.Metrics
|
||||
proxy *proxy.Metrics
|
||||
}
|
||||
|
||||
// metricsProvider returns consensus, p2p, mempool, state, statesync Metrics.
|
||||
@@ -944,6 +944,7 @@ func defaultMetricsProvider(cfg *config.InstrumentationConfig) metricsProvider {
|
||||
mempool.PrometheusMetrics(cfg.Namespace, "chain_id", chainID),
|
||||
sm.PrometheusMetrics(cfg.Namespace, "chain_id", chainID),
|
||||
statesync.PrometheusMetrics(cfg.Namespace, "chain_id", chainID),
|
||||
proxy.PrometheusMetrics(cfg.Namespace, "chain_id", chainID),
|
||||
}
|
||||
}
|
||||
return &nodeMetrics{
|
||||
@@ -952,6 +953,7 @@ func defaultMetricsProvider(cfg *config.InstrumentationConfig) metricsProvider {
|
||||
mempool.NopMetrics(),
|
||||
sm.NopMetrics(),
|
||||
statesync.NopMetrics(),
|
||||
proxy.NopMetrics(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ func initDBs(cfg *config.Config, dbProvider config.DBProvider) (blockStore *stor
|
||||
return
|
||||
}
|
||||
|
||||
func createAndStartProxyAppConns(clientCreator abciclient.Creator, logger log.Logger) (proxy.AppConns, error) {
|
||||
proxyApp := proxy.NewAppConns(clientCreator)
|
||||
func createAndStartProxyAppConns(clientCreator abciclient.Creator, logger log.Logger, metrics *proxy.Metrics) (proxy.AppConns, error) {
|
||||
proxyApp := proxy.NewAppConns(clientCreator, metrics)
|
||||
proxyApp.SetLogger(logger.With("module", "proxy"))
|
||||
if err := proxyApp.Start(); err != nil {
|
||||
return nil, fmt.Errorf("error starting proxy app connections: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user