Export bitcoind metrics through prometheus or otel
  • Go 94.7%
  • Shell 4.8%
  • Dockerfile 0.5%
Find a file
aad 45bc72a264
All checks were successful
Run Gosec / GoSec Security Scanner (push) Successful in 44s
Release / release (push) Successful in 58s
Merge pull request 'append _in to incoming ipv4/6 connection metric name' (#25) from fix/metric-name-connections into main
Reviewed-on: #25
2026-06-26 22:50:44 +00:00
.forgejo/workflows use mirror 2026-06-27 00:44:24 +02:00
config add otel exporter 2026-06-18 12:31:54 +02:00
fetcher feat: add count per connetion type 2026-06-27 00:29:45 +02:00
otel append _in to incoming ipv4/6 connection metric name 2026-06-27 00:50:24 +02:00
packaging fix: postinstall 2026-06-27 00:35:02 +02:00
prometheus rename total connections 2026-06-23 12:16:04 +02:00
scripts actually add the file 2026-06-20 14:46:26 +02:00
util feat: implement cookie auth 2025-05-06 19:04:00 +02:00
zmq add debian package build 2026-06-19 11:41:22 +02:00
.gitignore feat: add count per connetion type 2026-06-27 00:29:45 +02:00
.goreleaser.yml fix: force gitea token 2026-06-19 22:40:55 +02:00
Containerfile actually add the file 2026-06-20 14:46:26 +02:00
go.mod add debian package build 2026-06-19 11:41:22 +02:00
go.sum add otel exporter 2026-06-18 12:31:54 +02:00
LICENSE Initial commit 2024-06-17 00:23:23 +02:00
main.go add debian package build 2026-06-19 11:41:22 +02:00
README.md fix: release to forgejo, update package name 2026-06-19 22:35:51 +02:00
version.go feat: make log-level customizable 2024-06-17 20:31:52 +02:00

Bitcoind Prometheus Exporter ₿

Prometheus and OTel metrics for a bitcoin node made simple

Buid License

🔍 About the project

A Prometheus and OTel Exporter, which provides a deep insight into a Bitcoin full node.

⚙️ Configuration

This tool is configured via environment variables. Some environment variables are required and some activate additional functionalities.

Variable Description Required Default
PROMETHEUS_ENABLED Whether Prometheus is enabled true
RPC_ADDRESS The RPC address for the Bitcoin full node, e.g. http://127.0.0.1:8332
RPC_USER The user name that was defined in the Bitcoin Node configuration
RPC_PASS The password that was set in the Bitcoin Node configuration
RPC_COOKIE_FILE The path to the cookie file
ZMQ_ADDRESS The address to the ZeroMQ interface of the Bitcoin Fullnode. This variable is required to determine the transcation rates. e.g. 127.0.0.1:28333
FETCH_INTERVAL The interval at which the metrics are to be recalculated. 10
METRIC_PORT The port via which the metrics are provided. 3000
LOG_LEVEL The log level for the service info
OTEL_ENABLED Whether OpenTelemetry is enabled false
OTEL_EXPORTER_OTLP_ENDPOINT The OTLP endpoint for the OpenTelemetry collector otel-collector:4317
OTEL_SERVICE_NAME The service name for the OpenTelemetry collector bitcoind-metrics-exporter

Please note that either RPC_USER and RPC_PASS or RPC_COOKIE_FILE must be set.

💻 Grafana Dashboard

The official Grafana dashboard can be found here: https://grafana.com/grafana/dashboards/21351

Debian

Install as systemd service

curl -fsSL https://git.aads.cloud/api/packages/aad/debian/repository.key | sudo gpg --dearmor -o /usr/share/keyrings/bitcoind-metrics-exporter.gpg
echo "deb [signed-by=/usr/share/keyrings/bitcoind-metrics-exporter.gpg] https://git.aads.cloud/api/packages/aad/debian stable main" | sudo tee /etc/apt/sources.list.d/bitcoind-metrics-exporter.list
sudo apt update
sudo apt install bitcoind-metrics-exporter
sudo $EDITOR /etc/bitcoind-metrics-exporter/bitcoind-metrics-exporter.env
sudo systemctl start bitcoind-metrics-exporter

Alternatively, you can download the latest release from the releases page, or run with Docker.

🐳 Run with Docker

Prometheus

Docker-CLI

docker run -d --name bitcoind_exporter \
  -e RPC_ADDRESS=http://127.0.0.1:8332 \
  -e RPC_USER=mempool \
  -e RPC_PASS=mempool \
  -e ZMQ_ADDRESS=127.0.0.1:28333 \
  -e PROMETHEUS_ENABLED=true \
  -v /path/to/cookie/.cookie:/.cookie:ro \
  -p 3000:3000 \
   git.aads.cloud/aad/bitcoind-metrics-exporter:latest

🚀 Docker-Compose

vim docker-compose.yml
version: "3.8"
services:
  bitcoind_exporter:
    image: git.aads.cloud/aad/bitcoind-metrics-exporter:latest
    ports:
      - "3000:3000"    
    environment:
      - PROMETHEUS_ENABLED=true
      - RPC_ADDRESS=http://127.0.0.1:8332
      - RPC_USER=mempool
      - RPC_PASS=mempool
      - ZMQ_ADDRESS=127.0.0.1:28333
    # Optional, only necessary if Cookie-Auth is to be used
    volumes:
      - /path/to/cookie/.cookie:/.cookie:ro
    restart: always
docker-compose up -d

Otel

Docker-CLI

docker run -d --name bitcoind_exporter \
  -e RPC_ADDRESS=http://127.0.0.1:8332 \
  -e RPC_USER=mempool \
  -e RPC_PASS=mempool \
  -e ZMQ_ADDRESS=127.0.0.1:28333 \
  -e OTEL_ENABLED=true \
  -e OTEL_ENDPOINT= http://localhost:4123 \
  -v /path/to/cookie/.cookie:/.cookie:ro \
   git.aads.cloud/aad/bitcoind-metrics-exporter:latest

🚀 Docker-Compose

vim docker-compose.yml
version: "3.8"
services:
  bitcoind_exporter:
    image: git.aads.cloud/aad/bitcoind-metrics-exporter:latest
    environment:
      - OTEL_ENABLED=true
      - OTEL_ENDPOINT= http://localhost:4123
      - RPC_ADDRESS=http://127.0.0.1:8332
      - RPC_USER=mempool
      - RPC_PASS=mempool
      - ZMQ_ADDRESS=127.0.0.1:28333
    # Optional, only necessary if Cookie-Auth is to be used
    volumes:
      - /path/to/cookie/.cookie:/.cookie:ro
    restart: always
docker-compose up -d