Prometheus exporter for manyfold metrics
The Manyfold Metrics Server exposes the following Prometheus metrics:
- manyfold_user_count: Total number of users in the system.
- manyfold_library_count: Total number of libraries.
- manyfold_model_count: Total number of models in the system.
- manyfold_file_count: Total number of files associated with models.
- manyfold_tag_count: Total number of tags.
- manyfold_creator_count: Total number of creators.
- manyfold_models_per_tag: The number of models per tag, with
tag_nameas a label.
This project provides a metrics server that exposes various metrics related to the Manyfold application. These metrics can be scraped by Prometheus for monitoring purposes.
First, clone the repository to your local machine:
git clone https://github.com/ZoesDev/manyfold-exporter.git
cd manyfold-metricsNext, install the necessary dependencies using npm:
npm installThis will install the required libraries and modules for running the server.
Create a .env file in the root directory of the project. You can copy and modify the following example:
# Database connection
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=your_db_name
# Server settings
PORT=3000Make sure to replace the database settings with your actual database connection information.
Once you’ve installed the dependencies and configured your .env file, you can start the server by running:
npm startThe server will start running on port 3000 by default, but you can change this in the .env file.
After starting the server, you can access the Prometheus metrics at:
http://localhost:3000/metrics
You can configure Prometheus to scrape this endpoint to collect the metrics.
The root page (http://localhost:3000/) will also show a simple overview with the version number and a link to the metrics page.