Skip to content

Commit

Permalink
metrics: add some extra feature flags in node info;
Browse files Browse the repository at this point in the history
  • Loading branch information
galaio committed Aug 27, 2024
1 parent 75af65d commit fc90bfb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
utils.SetupMetrics(ctx,
utils.EnableBuildInfo(git.Commit, git.Date),
utils.EnableMinerInfo(ctx, &cfg.Eth.Miner),
utils.EnableNodeInfo(&cfg.Eth.TxPool, stack.Server().NodeInfo()),
utils.EnableNodeInfo(ctx, &cfg.Eth, stack),
)
return stack, backend
}
Expand Down
9 changes: 8 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,9 @@ func RegisterFilterAPI(stack *node.Node, backend ethapi.Backend, ethcfg *ethconf
return filterSystem
}

func EnableNodeInfo(poolConfig *legacypool.Config, nodeInfo *p2p.NodeInfo) SetupMetricsOption {
func EnableNodeInfo(ctx *cli.Context, cfg *ethconfig.Config, stack *node.Node) SetupMetricsOption {
poolConfig := cfg.TxPool
nodeInfo := stack.Server().NodeInfo()
return func() {
// register node info into metrics
metrics.NewRegisteredLabel("node-info", nil).Mark(map[string]interface{}{
Expand All @@ -2293,6 +2295,11 @@ func EnableNodeInfo(poolConfig *legacypool.Config, nodeInfo *p2p.NodeInfo) Setup
"AccountQueue": poolConfig.AccountQueue,
"GlobalQueue": poolConfig.GlobalQueue,
"Lifetime": poolConfig.Lifetime,
"Miner": ctx.Bool(MiningEnabledFlag.Name),
"Mev": cfg.Miner.Mev.Enabled,
"FFVoter": cfg.Miner.VoteEnable,
"PBSS": cfg.StateScheme == rawdb.PathScheme,
"MultiDB": stack.CheckIfMultiDataBase(),
})
}
}
Expand Down

0 comments on commit fc90bfb

Please sign in to comment.