Go-Ethereum-By-Instance 1,9031,903
When starting go-ethereum(aka: geth), it is necessary to add the --metrics and --metrics.expensive parameters. eg:
geth <other commands> --metrics --metrics.addr 127.0.0.1 --metrics.port 6060 --metrics.expensive
Prometheus collects metrics using the following method:
- job_name: 'go-ethereum'
scrape_interval: 10s
metrics_path: /debug/metrics/prometheus
static_configs:
- targets:
- '127.0.0.1:6060'
labels:
chain: ethereum
And If you need to collect rpc related metrics, add a Prometheus recording rule as below:
groups:
- name: geth_rpc_requests_rules
rules:
- expr: label_replace({__name__=~"rpc_duration_.*_success"}, "method", "$1", "__name__", "rpc_duration_(.+)_success")
record: geth_rpc_requests_success
- expr: label_replace({__name__=~"rpc_duration_.*_failure"}, "method", "$1", "__name__", "rpc_duration_(.+)_failure")
record: geth_rpc_requests_failure
- expr: label_replace({__name__=~"rpc_duration_.*_success_count"}, "method", "$1", "__name__", "rpc_duration_(.+)_success_count")
record: geth_rpc_requests_success_count
- expr: label_replace({__name__=~"rpc_duration_.*_failure_count"}, "method", "$1", "__name__", "rpc_duration_(.+)_failure_count")
record: geth_rpc_requests_failure_count
Used Metrics 118118
chain_head_header
chain_head_receipt
chain_head_block
chain_reorg_add
txpool_pending
txpool_queued
txpool_local
chain_reorg_drop
chain_execution
chain_validation
chain_write
chain_account_reads
chain_account_updates
chain_account_hashes
chain_account_commits
chain_storage_reads
chain_storage_updates
chain_storage_hashes
chain_storage_commits
chain_snapshot_commits
txpool_valid
txpool_invalid
txpool_underpriced
txpool_pending_discard
txpool_pending_replace
txpool_pending_ratelimit
txpool_pending_nofunds
txpool_queued_discard
txpool_queued_replace
txpool_queued_ratelimit
txpool_queued_nofunds
txpool_known
geth_rpc_requests_success_count
geth_rpc_requests_failure_count
geth_rpc_requests_success
e6
e200
geth_rpc_requests_failure
system_cpu_sysload
system_cpu_syswait
system_cpu_procload
system_cpu_goroutines
system_cpu_threads
system_memory_allocs
system_memory_used
system_memory_held
system_memory_frees
system_memory_pauses
system_disk_readbytes
system_disk_writebytes
p2p_ingress
p2p_egress
p2p_peers
p2p_dials
p2p_serves
eth_downloader_throttle
eth_downloader_bodies_in
eth_downloader_headers_in
eth_downloader_receipts_in
eth_downloader_bodies_drop
eth_downloader_headers_drop
eth_downloader_receipts_drop
eth_downloader_bodies_timeout
eth_downloader_headers_timeout
eth_downloader_receipts_timeout
eth_downloader_bodies_req
eth_downloader_headers_req
eth_downloader_receipts_req
eth_fetcher_transaction_waiting_peers
eth_fetcher_transaction_waiting_hashes
eth_fetcher_transaction_queueing_peers
eth_fetcher_transaction_queueing_hashes
eth_fetcher_transaction_fetching_peers
eth_fetcher_transaction_fetching_hashes
eth_fetcher_transaction_request_out
eth_fetcher_transaction_request_fail
eth_fetcher_transaction_request_done
eth_fetcher_transaction_request_timeout
eth_fetcher_transaction_replies_in
eth_fetcher_transaction_replies_known
eth_fetcher_transaction_replies_underpriced
eth_fetcher_transaction_replies_otherreject
eth_fetcher_block_bodies
eth_fetcher_block_headers
eth_fetcher_block_filter_headers_in
eth_fetcher_block_filter_headers_out
eth_fetcher_block_filter_bodies_in
eth_fetcher_block_filter_bodies_out
eth_db_chaindata_disk_read
eth_db_chaindata_disk_write
eth_db_chaindata_ancient_read
eth_db_chaindata_ancient_write
eth_db_chaindata_compact_input
eth_db_chaindata_compact_output
eth_db_chaindata_disk_size
eth_db_chaindata_ancient_size
eth_db_chaindata_compact_writedelay_counter
eth_db_chaindata_compact_time
eth_db_chaindata_compact_nonlevel0
eth_db_chaindata_compact_level0
eth_db_chaindata_compact_memory
eth_db_chaindata_compact_seek
eth_db_chaindata_compact_writedelay_duration
trie_memcache_clean_read
trie_memcache_clean_write
trie_memcache_gc_size
trie_memcache_flush_size
trie_memcache_commit_size
trie_memcache_clean_hit
trie_memcache_clean_miss
trie_memcache_dirty_hit
trie_memcache_dirty_miss
trie_memcache_gc_nodes
trie_memcache_commit_nodes
trie_memcache_flush_nodes
trie_memcache_gc_time
trie_memcache_commit_time
trie_memcache_flush_time