Bitcoin node metrics exporter for Prometheus.
Example metrics data and json metrics.
Tested with bitcoin RPC clients:
- Bitcoin Core
0.18.1
- Bitcoin-ABC
0.20.0
- Bitcoin SV
0.2.1
Put in your docker-compose.yml
exporter:
image: 4ops/bitcoin-exporter:stable
ports:
- '9133:9133'
environment:
BITCOIN_RPCUSER: 'some_eusername'
BITCOIN_RPCPASSWORD: 'sEcReT_P@sSsW0Rd'
BITCOIN_RPCHOST: 'bitcoin.mycompany.org'
BITCOIN_RPCPORT: '8332'
See full example in docker directory.
Example spec for bitcoin-exporter
container:
- env:
- name: BITCOIN_RPCUSER
valueFrom:
secretKeyRef:
name: bitcoin-credentials
key: BITCOIN_RPCUSER
- name: BITCOIN_RPCPASSWORD
valueFrom:
secretKeyRef:
name: bitcoin-credentials
key: BITCOIN_RPCPASSWORD
- name: BITCOIN_RPCHOST
value: bitcoin.mycompany.org
- name: BITCOIN_RPCPORT
value: '18332'
image: 4ops/bitcoin-exporter:stable
readinessProbe:
httpGet:
path: /metrics
port: http-metrics
timeoutSeconds: 3
initialDelaySeconds: 5
periodSeconds: 10
name: metrics-exporter
ports:
- containerPort: 9133
name: http-metrics
protocol: TCP
resources:
requests:
cpu: 100m
memory: 200Mi
limits:
cpu: 100m
memory: 200Mi
securityContext:
allowPrivilegeEscalation: false
runAsGroup: 1000
runAsUser: 1000
procMount: Default
See full example in kubernetes directory.
Bitcoin exporter reads environments variables at startup. No more config files are required.
BITCOIN_RPCUSER
,BITCOIN_RPCPASSWORD
- bitcoin node RPC credentials.BITCOIN_RPCHOST
- hostname or IP address of bitcoin node.BITCOIN_RPCPORT
- port number for RPC connections.
BITCOIN_RPCSCHEME
-http
orhttps
. Default:http
METRICS_URL
- path for prometheus scrapes. Default:/metrics
METRICS_PORT
- metrics server port number. Default:9133
METRICS_PREFIX
- prefix for naming metrics. Default:bitcoin_
LOG_LEVEL
- logging verbosity level. Maybe on of:debug
,info
,notice
,warn
,warning
,error
. Silent by default.LOG_TIME
- if has any non-empty value, prints timestamp in ISO format.