This repository provides a demo site for prometheus, alertmanager, prometheus exporters, and grafana.
Site is provisioned with ansible running every day and on all commits to master branch. Everything is fully automated with travis ci pipeline. If you want to check ansible-playbook
output, go to last build.
Have a look at configuration files in group_vars/.
All applications should be running on their default ports.
App name | Address (HTTP) | Address (HTTPS) |
---|---|---|
node_exporter | demo.do.prometheus.io:9100 | node.demo.do.prometheus.io |
prometheus | demo.do.prometheus.io:9090 | prometheus.demo.do.prometheus.io |
alertmanager | demo.do.prometheus.io:9093 | alertmanager.demo.do.prometheus.io |
grafana | demo.do.prometheus.io:3000 | grafana.demo.do.prometheus.io |
Before running, golang is required to be installed on deployer machine (necessary to install random_exporter).
Most services can be accessed in two ways (links in Applications section. As an example, prometheus can be accessed via:
- http://demo.do.prometheus.io:9090 - default way
- https://prometheus.do.prometheus.io - workaround which in background communicates with prometheus via insecure, "default" channel mentioned above
This workaround was needed to solve issue cloudalchemy/demo-site#13.
You can easily run such setup yourself without much knowledge how any part of this works. You just need to do two things:
First of all you need to configure your inventory, ours is located in hosts
file. Here you set up your target hosts by changing value of ansible_host
variable. Also here you can exclude parts of this demo site, so if you don't need our website, you just remove this part:
[web]
demo
Accordingly you can exclude grafana, prometheus.
For security measures we encrypted some of our passwords, but it is easy to use yours! You can do it by replacing a file located at group_vars/grafana/vault
with following content:
vault_grafana_password: <<INSERT_YOUR_GRAFANA_PASSWORD>>
You will have to manually run go
command to download & copy the random
exporter binary to playbooks/files
directory.
- The binary will be downloaded at
GOPATH
location. The value ofGOPATH
can be found by runninggo env|grep GOPATH
command on your system.
go get -u github.com/prometheus/client_golang/examples/random
cp <GOPATH>/bin/random /path/to/demo-site/playbooks/files/
# Download roles
ansible-galaxy install -r roles/requirements.yml
# Run playbook
ansible-playbook site.yml
# or when using vault encrypted variables
ansible-playbook --vault-id @prompt site.yml
demo site is deployed using Cloud Alchemy ansible roles.