This is a simple Flask application that exposes metrics in Prometheus format using the prometheus_flask_exporter. To run the app, you need to have Python and pip installed on your machine, then install the required dependencies.
- Activate your virtual environment (if not already activated)
source venv/bin/activate # On macOS or Linux
- Install required packages
python -m pip install flask prometheus_flask_exporter
python -m pip install requests
- Start the flask application
python app.py
The different endpoints for the application are 127.0.0.1:5000/one
, 127.0.0.1:5000/two
, 127.0.0.1:5000/three
, 127.0.0.1:5000/four
and 127.0.0.1:5000/error
.
- In a new terminal, start the generator
python app-generator.py
It will be used in generating request for the Flask application at the different endpoints.
- Send the metrics to a monitoring tool for visualization. You can do this with OpenTelemetry and SigNoz, read the article here.