This codebase builds on the original ML_monitor as presented in https://github.com/wiatrak2/ml_monitor This repository work on local installation of Python only and DOES NOT Support Colab at the moment.
- python >= 3.6
- docker
- Clone and enter the repository
git clone https://github.com/sohiniroych/ML-Monitoring-with-Grafana.git
cd ML-Monitoring-with-Grafana
- Install package using
pip
pip install .
- Install and Setup docker
sudo snap install docker
sudo apt install docker-compose
This process will set up the docker image that houses the Grafana Dashboad!
- Enable docker using the command
cd docker
sudo docker-compose up
docker
directory contains an easy setup of tools used for metrics visualization and analysis. These are Prometheus and Grafana. You should firstly start these programs, withdocker-compose up
command. Now you should be able to reach the Grafana admin panel on http://localhost:3000.- Logging in for the first time use username: admin, password: ml_monitor
- To set up the ml_monitor sensing through post 9090, open a separate terminal and enter the following:
python
import ml_monitor
ml_monitor.control.start()
You will get a message that a Prometheus UI should be reachable on http://localhost:9090.
-
Setup Jupyter notebook and open the file "ML_minitoring_Grafana.ipynb" Run this file. The first part will train the model and in the end random test samples will be generated to mimic a production setup. Increase the number of "epochs" to run for a longer Production-like setup
-
Open the Grafana dashboard at http://localhost:3000 and monitor the "n_rmse" metric.