1 | # Ethereum exporter
|
2 |
|
3 | [![](https://images.microbadger.com/badges/image/4ops/ethereum-exporter.svg)](https://hub.docker.com/r/4ops/ethereum-exporter 'View on Docker Hub') [![install size](https://packagephobia.now.sh/badge?p=ethereum-exporter)](https://packagephobia.now.sh/result?p=ethereum-exporter)
|
4 |
|
5 | Collects statistics from parity or geth node via JSON-RPC and exports it in prometheus metrics format.
|
6 |
|
7 | Example [metrics data](https://github.com/4ops/ethereum-exporter/blob/master/examples/).
|
8 |
|
9 | # Compatibility
|
10 |
|
11 | Tested with ethereum RPC clients:
|
12 |
|
13 | - Geth `v1.8.27`
|
14 | - Parity-Ethereum `v2.5.5`
|
15 |
|
16 | # Installation
|
17 |
|
18 | ## Docker
|
19 |
|
20 | Put in your `docker-compose.yml`
|
21 |
|
22 | ```YAML
|
23 | exporter:
|
24 | image: 4ops/ethereum-exporter:v0.1.0
|
25 | ports:
|
26 | - '9133:9133'
|
27 | environment:
|
28 | ETHEREUM_API_URL: http://geth:8545
|
29 | ```
|
30 |
|
31 | See full example in [docker](https://github.com/4ops/ethereum-exporter/tree/master/examples/docker) directory.
|
32 |
|
33 | ## Kubernetes
|
34 |
|
35 | Example spec for `ethereum-exporter` container:
|
36 |
|
37 | ```YAML
|
38 | - env:
|
39 | - name: ETHEREUM_API_URL
|
40 | valueFrom:
|
41 | secretKeyRef:
|
42 | name: geth-credentials
|
43 | key: ETHEREUM_API_URL
|
44 | image: 4ops/ethereum-exporter:v0.1.0
|
45 | readinessProbe:
|
46 | httpGet:
|
47 | path: /metrics
|
48 | port: http-metrics
|
49 | timeoutSeconds: 3
|
50 | initialDelaySeconds: 5
|
51 | periodSeconds: 10
|
52 | name: metrics-exporter
|
53 | ports:
|
54 | - containerPort: 9144
|
55 | name: http-metrics
|
56 | protocol: TCP
|
57 | resources:
|
58 | requests:
|
59 | cpu: 100m
|
60 | memory: 200Mi
|
61 | limits:
|
62 | cpu: 100m
|
63 | memory: 200Mi
|
64 | securityContext:
|
65 | allowPrivilegeEscalation: false
|
66 | runAsGroup: 1000
|
67 | runAsUser: 1000
|
68 | procMount: Default
|
69 | ```
|
70 |
|
71 | See full example in [kubernetes](https://github.com/4ops/ethereum-exporter/tree/master/examples/kubernetes) directory.
|
72 |
|
73 | # Configuration
|
74 |
|
75 | Ethereum exporter reads environments variables at startup. No more config files are required.
|
76 |
|
77 | ## Ethereum node options
|
78 |
|
79 | - `ETHEREUM_API_URL` - path to http(s) api interface.
|
80 |
|
81 | ## Metrics options
|
82 |
|
83 | - `METRICS_URL` - path for prometheus scrapes. Default: `/metrics`
|
84 | - `METRICS_PORT` - metrics server port number. Default: `9144`
|
85 | - `METRICS_PREFIX` - prefix for naming metrics. Default: `ethereum_`
|
86 |
|
87 | ## Logging
|
88 |
|
89 | - `LOG_LEVEL` - logging verbosity level. Maybe on of: `debug`, `info`, `notice`, `warn`, `warning`, `error`.
|
90 | - `LOG_TIME` - timestamp format in logs. Default - none. Any non-empty value prints timestamps (ISO 8601 format).
|