Parse various casper endpoints into prometheus client
StatusNodePromGrab.py requires python 3 to be installed and the following dependencies:
pip3 install requests prometheus_client twisted
There are 3 variables you can configure at the top of StatusNodePromGrab.py Set the url to your casper node status endpoint:
endpoint_url = "http://localhost:8888/status"
Set your refresh interval in seconds, at some point this will become more intelligent based on average block times:
interval = 60
Set the port you wish to run the service on:
default_port = 8123
This will run as a standard python cli script using twisted's reactor to serve it
python3 StatusNodePromGrab.py
If you want to run as a headless application for use as a daemon then Twisted's twisd is better. To run under twistd simply run the command below in your shell, shell script, cron job or systemd etc.
twistd3 -y StatusNodePromGrab.py