internal/proxy: add initial set of abci metrics

This commit is contained in:
William Banfield
2021-10-12 13:33:38 -04:00
parent 3646b635d3
commit 4396224c1f
8 changed files with 120 additions and 20 deletions

View File

@@ -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(),
}
}
}