Skip to content

Commit

Permalink
metrics: add txpool config into metrics server
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Jul 31, 2023
1 parent f616c36 commit 6b595c8
Show file tree
Hide file tree
Showing 36 changed files with 111 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
utils.SetupMetrics(ctx,
utils.EnableBuildInfo(gitCommit, gitDate),
utils.EnableMinerInfo(ctx, cfg.Eth.Miner),
utils.EnableNodeInfo(cfg.Eth.TxPool),
)
return stack, backend
}
Expand Down
15 changes: 15 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,21 @@ func EnableMinerInfo(ctx *cli.Context, minerConfig miner.Config) SetupMetricsOpt
}
}

func EnableNodeInfo(poolConfig core.TxPoolConfig) SetupMetricsOption {
return func() {
// register node info into metrics
metrics.NewRegisteredLabel("node-info", nil).Mark(map[string]interface{}{
"PriceLimit": poolConfig.PriceLimit,
"PriceBump": poolConfig.PriceBump,
"AccountSlots": poolConfig.AccountSlots,
"GlobalSlots": poolConfig.GlobalSlots,
"AccountQueue": poolConfig.AccountQueue,
"GlobalQueue": poolConfig.GlobalQueue,
"Lifetime": poolConfig.Lifetime,
})
}
}

func SetupMetrics(ctx *cli.Context, options ...SetupMetricsOption) {
if metrics.Enabled {
log.Info("Enabling metrics collection")
Expand Down
1 change: 1 addition & 0 deletions node/bsc.log
75 changes: 75 additions & 0 deletions node/bsc.log.2023-07-31_15
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
t=2023-07-31T15:11:59+0800 lvl=info msg="Set global gas cap" cap=50,000,000
t=2023-07-31T15:11:59+0800 lvl=info msg="Allocated trie memory caches" clean="1.17 GiB" dirty="1.95 GiB"
t=2023-07-31T15:11:59+0800 lvl=info msg="Allocated cache and file handles" database=/Users/zhouzuopai/GolandProjects/bsc/node/geth/chaindata cache="3.12 GiB" handles=5120
t=2023-07-31T15:11:59+0800 lvl=info msg="AncientDB item count" items=0
t=2023-07-31T15:11:59+0800 lvl=info msg="Opened ancient database" database=/Users/zhouzuopai/GolandProjects/bsc/node/geth/chaindata/ancient readonly=false frozen=0
t=2023-07-31T15:11:59+0800 lvl=info msg="Writing default main-net genesis block"
t=2023-07-31T15:11:59+0800 lvl=info msg="Persisted trie from memory database" nodes=12356 size="1.78 MiB" time=16.853291ms gcnodes=0 gcsize="0.00 B" gctime=0s livenodes=1 livesize="0.00 B"
t=2023-07-31T15:11:59+0800 lvl=info msg="Initialised chain configuration" config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Ramanujan: 0, Niels: 0, MirrorSync: 0, Bruno: 0, Berlin: 12244000, YOLO v3: <nil>, CatalystBlock: <nil>, London: 12965000, ArrowGlacier: 13773000, MergeFork:<nil>, Euler: 0, Gibbs: <nil>, Nano: <nil>, Moran: <nil>, Planck: <nil>,Luban: <nil>, Plato: <nil>, Hertz: <nil>, Engine: ethash}"
t=2023-07-31T15:11:59+0800 lvl=info msg="Unprotected transactions allowed"
t=2023-07-31T15:11:59+0800 lvl=info msg="Disk storage enabled for ethash caches" dir=/Users/zhouzuopai/GolandProjects/bsc/node/geth/ethash count=3
t=2023-07-31T15:11:59+0800 lvl=info msg="Disk storage enabled for ethash DAGs" dir=/Users/zhouzuopai/Library/Ethash count=2
t=2023-07-31T15:11:59+0800 lvl=info msg="Initialising Ethereum protocol" network=97 dbversion=<nil>
t=2023-07-31T15:11:59+0800 lvl=info msg="Loaded most recent local header" number=0 hash=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3 td=17,179,869,184 age=54y4mo1w
t=2023-07-31T15:11:59+0800 lvl=info msg="Loaded most recent local full block" number=0 hash=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3 td=17,179,869,184 age=54y4mo1w
t=2023-07-31T15:11:59+0800 lvl=info msg="Loaded most recent local fast block" number=0 hash=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3 td=17,179,869,184 age=54y4mo1w
t=2023-07-31T15:11:59+0800 lvl=warn msg="Failed to load snapshot, regenerating" err="missing or corrupted snapshot"
t=2023-07-31T15:11:59+0800 lvl=info msg="Rebuilding state snapshot"
t=2023-07-31T15:11:59+0800 lvl=warn msg="Sanitizing invalid txpool reannounce time" provided=0s updated=1m0s
t=2023-07-31T15:11:59+0800 lvl=info msg="Resuming state snapshot generation" root=0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544 accounts=0 slots=0 storage="0.00 B" elapsed="375.708µs"
t=2023-07-31T15:11:59+0800 lvl=warn msg="Sanitizing invalid gasprice oracle price cap" provided=<nil> updated=100,000,000,000
t=2023-07-31T15:11:59+0800 lvl=warn msg="Sanitizing invalid gasprice oracle ignore price" provided=<nil> updated=4
t=2023-07-31T15:11:59+0800 lvl=warn msg="Sanitizing invalid gasprice oracle max header history" provided=0 updated=1
t=2023-07-31T15:11:59+0800 lvl=warn msg="Sanitizing invalid gasprice oracle max block history" provided=0 updated=1
t=2023-07-31T15:11:59+0800 lvl=warn msg="Subscribe for vote or finalized header event failed"
t=2023-07-31T15:11:59+0800 lvl=warn msg="Error reading unclean shutdown markers" error="leveldb: not found"
t=2023-07-31T15:11:59+0800 lvl=info msg="Enabling metrics collection"
t=2023-07-31T15:11:59+0800 lvl=info msg="Starting peer-to-peer node" instance=Geth/v1.2.9-f616c36e-20230731/darwin-arm64/go1.19.3
t=2023-07-31T15:11:59+0800 lvl=info msg="New local node record" seq=1,690,787,519,476 id=24c06dbe9933f887dadc494a7924bc0651ccb6a5a823539809597f1076c1e4be ip=127.0.0.1 udp=30303 tcp=30303
t=2023-07-31T15:11:59+0800 lvl=info msg="Started P2P networking" self=enode://4005850d6419c08b4f50ac75f5da7b19fbc6d6cdc4424dac4fb3a21923b035aa068f3c9067501d4f10f9f58c1650b7e380764685da20d676340f0e3406c3e6c2@127.0.0.1:30303
t=2023-07-31T15:11:59+0800 lvl=info msg="IPC endpoint opened" url=/Users/zhouzuopai/GolandProjects/bsc/node/geth.ipc
t=2023-07-31T15:11:59+0800 lvl=eror msg="Unavailable modules in HTTP API list" unavailable=[parlia] available="[admin debug web3 eth txpool personal ethash miner net]"
t=2023-07-31T15:11:59+0800 lvl=info msg="HTTP server started" endpoint=127.0.0.1:8575 prefix= cors= vhosts=*
t=2023-07-31T15:11:59+0800 lvl=info msg="Generated state snapshot" accounts=8893 slots=0 storage="409.64 KiB" elapsed=51.284ms
t=2023-07-31T15:12:10+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:12:22+0800 lvl=info msg="Looking for peers" peercount=0 tried=6 static=4
t=2023-07-31T15:12:33+0800 lvl=info msg="Looking for peers" peercount=0 tried=0 static=4
t=2023-07-31T15:12:52+0800 lvl=info msg="Looking for peers" peercount=0 tried=5 static=4
t=2023-07-31T15:13:09+0800 lvl=info msg="Looking for peers" peercount=0 tried=0 static=4
t=2023-07-31T15:13:44+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:14:19+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:14:54+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:15:29+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:16:04+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:16:39+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:17:14+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:17:49+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:18:24+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:18:59+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:19:34+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:20:09+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:20:44+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:21:19+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:21:54+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:22:29+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:23:04+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:23:39+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:24:14+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:24:49+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:25:24+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:25:59+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:26:34+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:27:09+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:27:44+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:28:19+0800 lvl=info msg="Looking for peers" peercount=0 tried=4 static=4
t=2023-07-31T15:28:34+0800 lvl=info msg="Got interrupt, shutting down..."
t=2023-07-31T15:28:34+0800 lvl=warn msg="HTTP server graceful shutdown timed out"
t=2023-07-31T15:28:34+0800 lvl=info msg="HTTP server stopped" endpoint=127.0.0.1:8575
t=2023-07-31T15:28:34+0800 lvl=info msg="IPC endpoint closed" url=/Users/zhouzuopai/GolandProjects/bsc/node/geth.ipc
t=2023-07-31T15:28:34+0800 lvl=info msg="Ethereum protocol stopped"
t=2023-07-31T15:28:34+0800 lvl=info msg="Transaction pool stopped"
t=2023-07-31T15:28:34+0800 lvl=info msg="Writing snapshot state to disk" root=0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544
t=2023-07-31T15:28:34+0800 lvl=info msg="Persisted trie from memory database" nodes=0 size="0.00 B" time="2.958µs" gcnodes=0 gcsize="0.00 B" gctime=0s livenodes=1 livesize="0.00 B"
t=2023-07-31T15:28:34+0800 lvl=info msg="Writing clean trie cache to disk" path=/Users/zhouzuopai/GolandProjects/bsc/node/geth/triecache threads=8
t=2023-07-31T15:28:34+0800 lvl=info msg="Persisted the clean trie cache" path=/Users/zhouzuopai/GolandProjects/bsc/node/geth/triecache elapsed=7.276ms
t=2023-07-31T15:28:34+0800 lvl=info msg="Blockchain stopped"
Empty file added node/geth/LOCK
Empty file.
Binary file added node/geth/chaindata/000001.log
Binary file not shown.
1 change: 1 addition & 0 deletions node/geth/chaindata/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000000
Empty file added node/geth/chaindata/LOCK
Empty file.
8 changes: 8 additions & 0 deletions node/geth/chaindata/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=============== Jul 31, 2023 (CST) ===============
15:11:59.230329 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
15:11:59.246451 db@open opening
15:11:59.271295 version@stat F·[] S·0B[] Sc·[]
15:11:59.279612 db@janitor F·2 G·0
15:11:59.279642 db@open done T·33.171875ms
15:28:34.176360 db@close closing
15:28:34.176650 db@close done T·290µs
Binary file added node/geth/chaindata/MANIFEST-000000
Binary file not shown.
Empty file.
Empty file.
Binary file added node/geth/chaindata/ancient/bodies.cidx
Binary file not shown.
Empty file.
Binary file added node/geth/chaindata/ancient/diffs.ridx
Binary file not shown.
Empty file.
Binary file added node/geth/chaindata/ancient/hashes.ridx
Binary file not shown.
Empty file.
Binary file added node/geth/chaindata/ancient/headers.cidx
Binary file not shown.
Empty file.
Binary file added node/geth/chaindata/ancient/receipts.cidx
Binary file not shown.
1 change: 1 addition & 0 deletions node/geth/nodekey
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b9630ab56658bacc3749b66984df5aa2dc3e30217f7ecc86d9ba2eda5f1c8300
Binary file added node/geth/nodes/000001.log
Binary file not shown.
1 change: 1 addition & 0 deletions node/geth/nodes/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000000
Empty file added node/geth/nodes/LOCK
Empty file.
8 changes: 8 additions & 0 deletions node/geth/nodes/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=============== Jul 31, 2023 (CST) ===============
15:11:59.462270 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
15:11:59.472488 db@open opening
15:11:59.473174 version@stat F·[] S·0B[] Sc·[]
15:11:59.475608 db@janitor F·2 G·0
15:11:59.475684 db@open done T·3.17875ms
15:28:34.176826 db@close closing
15:28:34.177060 db@close done T·230.583µs
Binary file added node/geth/nodes/MANIFEST-000000
Binary file not shown.
Binary file added node/geth/triecache/data.0.bin
Binary file not shown.
Binary file added node/geth/triecache/data.1.bin
Binary file not shown.
Binary file added node/geth/triecache/data.2.bin
Binary file not shown.
Binary file added node/geth/triecache/data.3.bin
Binary file not shown.
Binary file added node/geth/triecache/data.4.bin
Binary file not shown.
Binary file added node/geth/triecache/data.5.bin
Binary file not shown.
Binary file added node/geth/triecache/data.6.bin
Binary file not shown.
Binary file added node/geth/triecache/data.7.bin
Binary file not shown.
Binary file added node/geth/triecache/metadata.bin
Binary file not shown.

0 comments on commit 6b595c8

Please sign in to comment.