This repo contains the materials that I have prepared and referred to while exploring monitoring in Python.
- Understanding metrics and monitoring with Python
- Exploring Security, Metrics, and Error-handling with gRPC in Python
- Your options for monitoring multi-process Python applications with Prometheus
- Monitoring Your Synchronous Python Web Applications Using Prometheus
- Monitoring Your Asynchronous Python Web Applications Using Prometheus
I recommend using a VM to play with the demos. This repo ships with a Vagrantfile for installing Ubuntu 16.04. Please install Vagrant for your operating system and then:
You will need to open a powershell session as Adminstrator and do the following from a clone of the git repository:
C:\> ~\work\github.com\amitsaha\python-monitoring-talk [master ≡]> vagrant up --provider=hyperv
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Importing a Hyper-V instance
default: Please choose a switch to attach to your Hyper-V instance.
default: If none of these are appropriate, please open the Hyper-V manager
default: to create a new virtual switch.
default:
default: 1) Default Switch
default: 2) nat
default: 3) minikube-virtualswitch
default:
default: What switch would you like to use? 1
default: Cloning virtual hard drive...
default: Creating and registering the VM...
default: Setting VM Integration Services
default: Successfully imported a VM with name: ubuntu-18.04-amd64_1
==> default: Starting the machine...
==> default: Waiting for the machine to report its IP address...
default: Timeout: 120 seconds
Then, we will ssh
into the VM using:
C:\> ~\work\github.com\amitsaha\python-monitoring-talk [master ≡]> vagrant ssh
$ vagrant up
...
$ vagrant ssh
Now, that we are in the VM, the /vagrant
directory has a copy of the entire repository from where you
can play with the demos:
$ cd /vagrant
$ ls
demo1 LICENSE prometheus scripts statsd Vagrantfile
demo2 opensource-com-article README.md slides statsd_prometheus
Demos:
Each demo directory above has a README explaining the instructions of playing with the demo. In general, to access a network port running in the virtual machine, use the following address in your browser:
$ 127.0.0.1:port
If it doesn't work, please file an issue with OS + VM details.
The following resources are some of the ones that I found very useful:
- Monitoring Distributed Systems
- Monitoring best practices
- Who wants seconds?
- Monitoring: Not just for outages
- Avoid the wall of graphs
- Latency primer