31z4/ethereum-prometheus-exporter

By 31z4

Updated almost 2 years ago

Prometheus exporter for Ethereum client metrics

Image
1

10K+

This service exports various metrics from Ethereum clients for consumption by Prometheus. It uses JSON-RPC interface to collect the metrics. Any JSON-RPC 2.0 enabled client should be supported. Although, it has only been tested with OpenEthereum.

Usage

You can deploy this exporter using the 31z4/ethereum-prometheus-exporter Docker image.

docker run -d -p 9368:9368 --name ethereum-exporter 31z4/ethereum-prometheus-exporter -url http://ethereum:8545

Keep in mind that your container needs to be able to communicate with the Ethereum client using the specified url (default is http://localhost:8545).

By default the exporter serves on :9368 at /metrics. The listen address can be changed by specifying the -addr flag.

Here is an example scrape_config for Prometheus.

- job_name: ethereum
  static_configs:
  - targets:
    - ethereum-exporter:9368

Exported Metrics

NameDescription
net_peersNumber of peers currently connected to the client.
eth_block_numberNumber of the most recent block.
eth_block_timestampTimestamp of the most recent block.
eth_gas_priceCurrent gas price in wei. Might be inaccurate.
eth_earliest_block_transactionsNumber of transactions in the earliest block.
eth_latest_block_transactionsNumber of transactions in the latest block.
eth_pending_block_transactionsThe number of transactions in pending block.
eth_hashrateHashes per second that this node is mining with.
eth_sync_startingBlock number at which current import started.
eth_sync_currentNumber of most recent block.
eth_sync_highestEstimated number of highest block.
parity_net_active_peersNumber of active peers. Available only for OpenEthereum.
parity_net_connected_peersNumber of peers currently connected to this client. Available only for OpenEthereum.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Docker Pull Command

docker pull 31z4/ethereum-prometheus-exporter