Materials for my talks and articles on monitoring with focus on Python applications
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo1
demo2
opensource-com-article
prometheus
scripts
slides
statsd
statsd_prometheus
.gitignore
LICENSE
README.md
Vagrantfile

README.md

Materials for my talks/articles on Python monitoring

Slides

Articles

Playing with the demos

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:

VM Setup on Windows 10 with Hyper-V

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

VM Setup on Windows/Linux/OS X - VirtualBox

$ 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.

Miscellaneous notes

Docker tips

Rebuild an image:

$ sudo docker-compose -f docker-compose.yml build

If you see errors such as:

ERROR: for webapp Cannot create container for service webapp: Conflict. The container name "/webapp" is already in use by container "2e452aa1622b053fe33c6fe508ddce3f207e8a8c7446564f86e6f31c2d81466c". You have to remove (or rename) that container to be able to reuse that name.

You can do:

$ sudo docker rm webapp

ab tips

Make 100 requests with a concurrency of 3:

$ ab -n 100 -c 3 http://localhost:5000/test/

Learn more

The following resources are some of the ones that I found very useful:

General

Statsd/Graphite

Prometheus

Stage 3 Readings: Doing things right