blockchain and system metrics

Blockchain system metrics

Telemetry plugin (telemetry_plugin + prometheus + grafana)

DAOBet has a built-in mechanism for collecting system metrics of the blockchain (telemetry_plugin).
It is presented as a plugin that launches the http endpoint for the Prometheus service.
To enable it, add the following lines to config.ini:
"plugin = eosio :: telemetry_plugin" - enables the telemetry plugin
"telemetry-endpoint = <PORT>" - sets the port for starting the http server
"telemetry-uri = <URI>" - sets the URI path for metrics (recommended: / metrics)
"telemetry-threads = <THREADS_AMOUNT>" - sets the number of threads for telemetry (recommended: 2)
To collect metrics, it is recommended to run Prometheus and add a new target with the address of the telemetry plug-in to it. Charts can be displayed through the Grafana service.

RPC API nodes

Part of the metrics can be obtained through the RPC API.
We recommend the following calls:
  • /v1/net/connections - information about the current p2p connections. Detailed documentation: peers.
  • /v1/producer/paused - whether the producer is paused. Detailed documentation: paused
  • /v1/db_size/get - information about the current state of the state database (size, capacity, etc.). Detailed documentation: get-1.

RPC API nodes

Part of the on-chain metrics can be assembled using the RPC API nodes. To do this, we recommend using the following calls:
  • /v1/chain/get_info - allows you to get information about the main parameters of the network. Detailed documentation:
  • /v1/chain/get_producers - information about registered producers / validators. Detailed documentation: get_producers
  • /v1/chain/get_table_rows - you can get information from the tables of contracts. The most interesting tables of the eosio contract are from the scope of eosio: global, global2, global3, where the main dynamic parameters of the network are presented. Detailed documentation: get_table_rows.

MongoDB (mongo_db_plugin + mongoDB)

More detailed metrics and statistics can be obtained from MongoDB with mongo_db_plugin enabled in the node. A node with the mongo_db_plugin turned on writes detailed information about transactions, actions, accounts to mongo_db. When the plugin is turned on, the node needs to keep a constant connection with mongoDB, otherwise the node fails. Detailed documentation: mongo_db_pugin.
We do not recommend including mongo_db_plugin for the producer of the node and for the seed node, as the plug-in noticeably reduces performance

Metrics collection and visualization

The use of the Prometheus service is recommended for collecting metrics. For visualization, it is best to use the Grafana service.
For metrics from the RPC API and MongoDB, it is necessary to implement additional exporters in Prometheus, because they do not have the ability of exporting to any collectors. We recommend taking the open service as the basis:
it implements the export of the most important on-chain metrics from various sources (MongoDB, RPC API) to prometheus.
Last modified 2yr ago