|
| 1 | +# EVM RPC Websocket Exporter |
| 2 | +Simple exporter used to scrape different metrics from EVM compatible websocket RPCs. |
| 3 | + |
| 4 | +## Metrics |
| 5 | +For list of metrics and explanations please check [collect method](src/exporter.py#L42-L79) in exporter source-code. |
| 6 | +For available labels please see [metric_labels](src/exporter.py#L37-L40) list in exporter source-code. |
| 7 | + |
| 8 | +# Disclaimer |
| 9 | +Please note that this tool is in early development stage, and as such should not be used to influence business crictical decisions. |
| 10 | +The project in it's current form suits our short-term needs and will receive limited support. We encourage you to fork the project, and extend it with additional functionality you might need. |
| 11 | +This project was inspired by [blackbox-websocket-exporter](https://github.com/smohsensh/blackbox-websocket-exporter) |
| 12 | + |
| 13 | +## Development |
| 14 | +It is recommended that you install [pre-commit](https://pre-commit.com/) so that automated linting and formatting checks are performed before each commit. Run: |
| 15 | +```bash |
| 16 | +pip install pre-commit |
| 17 | +pre-commit install |
| 18 | +``` |
| 19 | +### Running locally |
| 20 | +1. Make sure you have python3 installed (>3.9.10) |
| 21 | +1. Set-up your python environment |
| 22 | +```bash |
| 23 | +pip3 install virtualenv |
| 24 | +virtualenv venv |
| 25 | +source venv/bin/activate |
| 26 | +pip install -r requirements.txt |
| 27 | +``` |
| 28 | +1. Generate valid exporter config and validation file. For example see [config example](config/exporter_example/config.yml) and [validation example](config/exporter_example/validation.yml). |
| 29 | +1. Export paths of generated configuration files relative to `src/exporter.py`: |
| 30 | +```bash |
| 31 | +export VALIDATION_FILE_PATH="validation.yml" # For example if we saved validation config file in src/validation.yml |
| 32 | +export CONFIG_FILE_PATH="config.yml" # For example if we saved config file in src/config.yml |
| 33 | +``` |
| 34 | +1. Finally you can run the exporter |
| 35 | +```bash |
| 36 | +python exporter.py |
| 37 | +``` |
| 38 | +### Run with docker-compose |
| 39 | +1. Generate valid exporter config and validation file. For example see [config example](config/exporter_example/config.yml) and [validation example](config/exporter_example/validation.yml). |
| 40 | +1. Export paths of generated configuration files relative to `docker-compose.yml`: |
| 41 | +```bash |
| 42 | +export VALIDATION_FILE_PATH="src/validation.yml" # For example if we saved validation config file in src/validation.yml |
| 43 | +export CONFIG_FILE_PATH="src/config.yml" # For example if we saved config file in src/config.yml |
| 44 | +``` |
| 45 | +1. Execute |
| 46 | +```bash |
| 47 | +docker-compose build |
| 48 | +docker-compose-up |
| 49 | +curl localhost:8000/metrics # Exporter |
| 50 | +curl localhost:3000 # Grafana |
| 51 | +curl localhost:9090 # Prometheus |
| 52 | +``` |
0 commit comments