Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Latest commit

 

History

History
111 lines (85 loc) · 3.01 KB

README.md

File metadata and controls

111 lines (85 loc) · 3.01 KB

Bitcoin exporter

install size

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: Default

See 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 - http or https. Default: http

Metrics options

  • METRICS_URL - path for prometheus scrapes. Default: /metrics
  • METRICS_PORT - metrics server port number. Default: 9133
  • METRICS_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.