The Bitcoin node metrics exporter for Prometheus based on Rust Bitcoin Community's crate for Bitcoin JSON-RPC support, corepc-client. Why is that important? Other exporters use deprecated/archived crates like rust-bitcoincore-rpc or rust-bitcoind-json-rpc. Using this exporter helps you keep up to date with the Rust Bitcoin Community's work.
cargo install btcnode-metrics
After installing btcnode-metrics,
- Copy
config.toml.exampletoconfig.local.toml. - Edit
config.local.toml- the node section is for the Bitcoin node to monitor
- the server section is for exposing the endpoint for Prometheus
To run:
cargo run -- -c ./config.local.toml
For additional output, set the [logging level(https://docs.rs/env_logger/latest/env_logger/)]:
RUST_LOG=info cargo run -- -c ./config.local.toml
The Rust Bitcoin Community's corepc-client crate replaces the previous the Bitcoin node RPC crates that were archived on 11/25/2025:
This repository's code is separated into:
- btcnode-metrics implements the API for Prometheus to call for gathering metrics.
- btcnode_metrics_gatherer module gathers metrics from the Bitcoin node and transforms them into Prometheus format.