@ -171,7 +171,8 @@ func makeNode(cfg *config.Config,
return nil , combineCloseError ( err , makeCloser ( closers ) )
}
indexerService , eventSinks , err := createAndStartIndexerService ( cfg , dbProvider , eventBus , logger , genDoc . ChainID )
indexerService , eventSinks , err := createAndStartIndexerService ( cfg , dbProvider , eventBus ,
logger , genDoc . ChainID , nodeMetrics . indexer )
if err != nil {
return nil , combineCloseError ( err , makeCloser ( closers ) )
}
@ -900,11 +901,12 @@ func defaultGenesisDocProviderFunc(cfg *config.Config) genesisDocProvider {
type nodeMetrics struct {
consensus * consensus . Metrics
p2p * p2p . Metrics
indexer * indexer . Metrics
mempool * mempool . Metrics
p2p * p2p . Metrics
proxy * proxy . Metrics
state * sm . Metrics
statesync * statesync . Metrics
proxy * proxy . Metrics
}
// metricsProvider returns consensus, p2p, mempool, state, statesync Metrics.
@ -916,21 +918,23 @@ func defaultMetricsProvider(cfg *config.InstrumentationConfig) metricsProvider {
return func ( chainID string ) * nodeMetrics {
if cfg . Prometheus {
return & nodeMetrics {
consensus . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
p2p . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
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 ) ,
consensus : consensus . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
indexer : indexer . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
mempool : mempool . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
p2p : p2p . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
proxy : proxy . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
state : sm . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
statesync : statesync . PrometheusMetrics ( cfg . Namespace , "chain_id" , chainID ) ,
}
}
return & nodeMetrics {
consensus . NopMetrics ( ) ,
p2p . NopMetrics ( ) ,
mempool . NopMetrics ( ) ,
sm . NopMetrics ( ) ,
statesync . NopMetrics ( ) ,
proxy . NopMetrics ( ) ,
consensus : consensus . NopMetrics ( ) ,
indexer : indexer . NopMetrics ( ) ,
mempool : mempool . NopMetrics ( ) ,
p2p : p2p . NopMetrics ( ) ,
proxy : proxy . NopMetrics ( ) ,
state : sm . NopMetrics ( ) ,
statesync : statesync . NopMetrics ( ) ,
}
}
}