Add Prometheus bitcoin exporter to btc-node #25
No reviewers
Labels
No labels
IaC
admin
agent-containers
automation
blockchain
cleanup
data
documentation
hardware
hotfix
infrastructure
maintenance
metrics
ml
monitoring
networking
resilience
security
tailscale
trading
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
midwitmoneymgmt/m3-infra!25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "34-btc-prometheus-exporter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds jvstein/bitcoin-prometheus-exporter (nixpkgs:
prometheus-bitcoin-exporter) to the btc-node container, and wires the scrape target into the monitoring container.Changes
btc-node/configuration.nix:
prometheusRPC user with HMAC authservices.prometheus.exporters.bitcoinon port 9332monitoring/configuration.nix:
btc-nodescrape target at10.121.25.10:9332(30s interval)RPC Security
The
prometheusRPC user is restricted viarpcwhitelistto:getblockchaininfo,getnetworkinfo,getmempoolinfo,getpeerinfo,getnettotals,getmininginfo,uptime,getblockcount,getdifficulty,getbestblockhash,getblock.No wallet, transaction, or write methods are permitted.
Metrics Available
After deploy,
curl http://10.121.25.10:9332/metricswill expose: block height, peer count, mempool size/fees, difficulty, network hash rate, verification progress, connection counts, and bandwidth totals.Notes
pkgs.writeText— acceptable for a whitelist-restricted, container-local monitoring user. TODO: move to setec when exchange credentials are stored (#8).nixos/tests/prometheus-exporters.nix).Verification
After deploy:
curl http://10.121.25.10:9332/metrics | grep bitcoin_blocks— confirms exporter is runningbitcoin_blocks— confirms scraping worksjvstein/bitcoin-prometheus-exporter/dashboard/bitcoin-grafana.json(Grafana dashboard ID: 11274)Closes #34
Related: #23, #38
assigned to @AlexCaswen
approved this merge request
mentioned in commit
e7337adb1c