bitcoin-exporter
v0.1.5
Published
Collects statistics from bitcoin node via JSON-RPC and exports it in prometheus metrics format.
Downloads
37
Readme
Bitcoin exporter
Bitcoin node metrics exporter for Prometheus.
Example metrics data and json metrics.
Compatibility
Tested with bitcoin RPC clients:
- Bitcoin Core
0.18.1 - Bitcoin-ABC
0.20.0 - Bitcoin SV
0.2.1
Installation
Docker
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.
Kubernetes
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: DefaultSee full example in kubernetes directory.
Configuration
Bitcoin exporter reads environments variables at startup. No more config files are required.
Bitcoin node options
Required variables
BITCOIN_RPCUSER,BITCOIN_RPCPASSWORD- bitcoin node RPC credentials.BITCOIN_RPCHOST- hostname or IP address of bitcoin node.BITCOIN_RPCPORT- port number for RPC connections.
Not required
BITCOIN_RPCSCHEME-httporhttps. Default:http
Metrics options
METRICS_URL- path for prometheus scrapes. Default:/metricsMETRICS_PORT- metrics server port number. Default:9133METRICS_PREFIX- prefix for naming metrics. Default:bitcoin_
Logging
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.
