Demo repository with Prometheus and a simple Flask application
Clone the project, add an entry to ansible/files/htpasswd, and start the VM via Vagrant.
cd prometheus-demo-app
htpasswd -c ansible/files/htpasswd admin
vagrant up
- Get an API key via DO web interface
- Get your SSH key ID (if you don't have one associated with your account, add it via the DO web interface)
curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer $TOKEN' "https://api.digitalocean.com/v2/account/keys"
- Fill in the
do_api_key
anddo_ssh_key_id
variables in ansible/droplet.yml - Run the droplet creation playbook
cd ansible
ansible-playbook -i do-inventory droplet.yml
- Get the IP address of the droplet (shown at the end of the playbook run)
- Add a user to the ansible/files/htpasswd file so you can log into Prometheus
htpasswd -c ansible/files/htpasswd admin
- Run the Prometheus playbook
ansible-playbook -i '$DOIPADDRESS,' -u root prometheus.yml
- Check the web interface, NGINX should be running on ports 80 and 443 (HTTPS uses self-signed certificate)
- (Optional) if used in combination with flask-demo-app, update the
prom_target_host
variable in ansible/prometheus.yml to point to your app