ethereum-exporter

0.1.1 • Public • Published

Ethereum exporter

install size

Collects statistics from parity or geth node via JSON-RPC and exports it in prometheus metrics format.

Example metrics data.

Compatibility

Tested with ethereum RPC clients:

  • Geth v1.8.27
  • Parity-Ethereum v2.5.5

Installation

Docker

Put in your docker-compose.yml

  exporter:
    image: 4ops/ethereum-exporter:v0.1.0
    ports:
      - '9133:9133'
    environment:
      ETHEREUM_API_URL: http://geth:8545

See full example in docker directory.

Kubernetes

Example spec for ethereum-exporter container:

- env:
    - name: ETHEREUM_API_URL
      valueFrom:
        secretKeyRef:
          name: geth-credentials
          key: ETHEREUM_API_URL
  image: 4ops/ethereum-exporter:v0.1.0
  readinessProbe:
    httpGet:
      path: /metrics
      port: http-metrics
    timeoutSeconds: 3
    initialDelaySeconds: 5
    periodSeconds: 10
  name: metrics-exporter
  ports:
    - containerPort: 9144
      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

Ethereum exporter reads environments variables at startup. No more config files are required.

Ethereum node options

  • ETHEREUM_API_URL - path to http(s) api interface.

Metrics options

  • METRICS_URL - path for prometheus scrapes. Default: /metrics
  • METRICS_PORT - metrics server port number. Default: 9144
  • METRICS_PREFIX - prefix for naming metrics. Default: ethereum_

Logging

  • LOG_LEVEL - logging verbosity level. Maybe on of: debug, info, notice, warn, warning, error.
  • LOG_TIME - timestamp format in logs. Default - none. Any non-empty value prints timestamps (ISO 8601 format).

Package Sidebar

Install

npm i ethereum-exporter

Weekly Downloads

3

Version

0.1.1

License

MIT

Unpacked Size

19.4 kB

Total Files

19

Last publish

Collaborators

  • 4ops