
gittech. site
for different kinds of informations and explorations.
Prometheus Exporter for Bitcoin Core
Published at
5 days ago
Main Article
bitcoin-core-exporter
Simple Prometheus exporter for exposing various metrics from a full Bitcoin Core node.
Setup
- Clone the repo on the same machine where the Bitcoin Core node is running.
git clone https://github.com/joetor5/bitcoin-core-exporter.git
cd bitcoin-core-exporter
- Create a Python venv and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Start the exporter
chmod +x bitcoin_exporter.py
./bitcoin_exporter.py &
This will start the exporter http server on port 8000 and collect metrics every 60 seconds. You can select a different port with the -p arg. Run with -h arg for general usage and options.
- View all the metrics (starting with bitcoin_)
curl http://localhost:8000/metrics
- Modify the prometheus.yml config for pulling these metrics from the exporter
scrape_configs:
- job_name: "bitcoin-core"
scrape_interval: 60s
static_configs:
- targets: ["localhost:8000"]