Beaker SRE
Documentation and tools for deploying a monitoring dashbaord for Beaker.
Architecture
- Beaker stores all relevant information in its MariaDB database
- Prometheus exporter scripts compute metrics (SLIs) from the data and present them via included web server
- Prometheus regularly scrapes the exporters endpoints and stores metrics in its database
- Grafana uses the prometheus as its datasource and visualize the metrics on a Dashboard
Deployment
All pieces are available as container images in public registries so using docker/podman would be the preferable method of deplyment. Described below is the manual deployment directly to host system I used on an older system without container support.
Prometheus
- create user prometheus
useradd prometheus
- as prometheus user in its homedir:
- download latest release from https://prometheus.io/download/
- untar and symlink to
prometheus
directory - deploy config file to the prometheus directory
- as root
- deploy service file to systemd
cp prometheus.service /etc/systemd/system/prometheus.service
systemctl enable prometheus.service
- start prometheus
systemctl start prometheus.service
- allow access from outside (optional):
firewall-cmd --add-port=9090/tcp --permanent
firewall-cmd --reload
- deploy service file to systemd
- Verify Prometheus functionality
- go to
http://ip.of.prometheus.server:9090
- go to
Blackbox exporter
- create user beaker-sre
useradd beaker-sre
- as beaker-sre user in its homedir:
- download latest binary release from
https://github.com/prometheus/blackbox_exporter/releases
- untar and symlink to
blackbox_exporter
directory
- download latest binary release from
- as root
- deploy service file to systemd
cp blackbox_exporter.service /etc/systemd/system/blackbox_exporter.service
systemctl enable blackbox_exporter.service
- start blackbox_exporter
systemctl start blackbox_exporter.service
- deploy service file to systemd
- Verify blackbox_exporter functionality
systemctl status blackbox_exporter
- go to
http://ip.of.prometheus.server:3000
, Status -> Targets- blackbox should be listed in blue color and as "(X/X up)"
- on the graph page, try to execute query using the blackbox_exporter's data, e.g.
probe_http_duration_seconds
.
Grafana
- create user grafana
useradd grafana
- as grafana user in its homedir:
- download latest standalone binary release from https://grafana.com/grafana/download?plcmt=top-nav&cta=downloads
- untar and symlink to
grafana
directory - install aditional plugins
./grafana-cli --pluginsDir /home/grafana/grafana/data/plugins/ plugins install fzakaria-simple-annotations-datasource
./grafana-cli --pluginsDir /home/grafana/grafana/data/plugins/ plugins install simpod-json-datasource
- as root
- deploy service file to systemd
cp grafana.service /etc/systemd/system/grafana.service
systemctl enable grafana.service
- start grafana
systemctl start grafana.service
- allow access from outside
firewall-cmd --add-port=3000/tcp --permanent
firewall-cmd --reload
- deploy service file to systemd
- Verify Grafana functionality
systemctl status grafana
- go to
http://ip.of.prometheus.server:3000
- Log in as admin/admin, change password to something secure
- Connect Grafana to Prometheus
- in WebUI navigate to Configuration -> Data sources -> Add data source -> Prometheus -> Select
- Use
http://localhost:9090
as the suggested URL, keep the rest on default values. Confirm.
- Setup Alerting as you see fit