Highly customizible prometheus exporter for subgraphs monitoring and alerting which have no particular limitations whatsoever. During the MIPs program we found that as Indexer, we need more control over subgraphs we are indexing, oracles subgraphs, epoch endpoint and preferible more.
Exporter doesn't requare any access to Indexer Stack and can be deployed anywhere, requare as minimum resources as single core VPS instance. However password and key aoutentification can be easily implemented for individual needs if any.
Exporter fetch data from subgraphs (or, actually any web sources) and expose in Prometheus format for centalized collectors as such as Grafana. Can be used for monitoring of any web source and check things like valitidy of SSL certificates, endpoints availabilities, chains progression and even GitHub new commits and releases.
Script goes through all the config files in the configs
directory and makes a request to the URL specified in the config.
Then it processes the response using the callback function specified in the config. Finally, it sets the Prometheus metrics with the values returned by the callback function.
The collected Prometheus metrics can be accessed at the /metrics
endpoint. By default, it uses 9090 port.
Check the example configs in the example-configs
directory. You can use them as a starting point to create your own configuration files.
To run outside of Docker, you need to have Node.js installed.
Then, run the following:
npm install
cp .env.example .env
- Edit
.env
file and set the variables - Create a directory
configs
in the root folder of the project:mkdir configs
. Copy the config files fromexample-configs
toconfigs
directory:cp example-configs/*.js configs/
- Run the script:
npm start
You may want to add the process to systemd or use some other process manager, like PM2.
Monitor subgraphs and get alerts for any available event. For example, number of entities in a subgraph and get an alert when it drops below a certain threshold. Monitor the number of entities in subgraph and get an alert when it grows above a certain threshold. Check the network health. Can use data returned by subgraphs, such as price or whatever to display it in your Grafana.
This directory contains example configuration files for the various use cases.
They can be used as a starting point to create your own configuration files.
Please check the README.md
file in the example-configs
directory for more information.
To run the tests, run the following command: npm test
.
Contributions are welcome! If you have any ideas or suggestions, please open an issue or a pull request.
MIT