π A simple, single-node, Docker-based Prometheus monitoring stack
- Prometheus server
- Prometheus Alertmanager
- Official Node/system metrics exporter
- Grafana for visualization
- Nginx reverse proxy with SSL/TLS Let's encrypt certificate
- Well known monitoring stack.
- Almost no configuration.
- Minimal requirements.
- High portability.
Only Docker and Docker compose are required to build the entire stack. Check out the installation instructions.
After cloning the repo on your Docker host, copy the example environment file to set your own values:
$ cp .env.example .env
Here are the environment variables and a short description for each:
GF_SECURITY_ADMIN_PASSWORD=secret # Password for the "admin" user in Grafana
EMAIL=mark@facebook.com # Email address to register with `letsencrypt`
DOMAIN=my-little-monitor.facebook.com # Domain name to be used by the Nginx proxy
ALERT_SLACK_USERNAME=Prometheus # Slack username in Prometheus server alerts
ALERT_SLACK_CHANNEL="#notifications" # Slack channel for Prometheus server alerts
ALERT_SLACK_INCOMING_WEBHOOK_URL=https://hooks.slack.com/whatever # Slack's incoming webhook URL to deliver Prometheus server alerts
All rules defined in config/alert.rules will be loaded by Alertmanager. A couple of pretty basic alerts are provided as part of the stack, but feel free to add yours. Check out the alerting rules docs.
From the root directory of this repo, run the command below:
$ docker-compose up -d
If everything goes well, the Grafana UI should be avilable at the
https:// DOMAIN
you specified:
e.g. https://my-little-monitor.facebook.com
In order to reach the Prometheus container, it is needed to create a Prometheus Data Source with the proper URL in Grafana:
- URL:
http://prometheus:9090
- Access:
proxy
After doing so, you are ready to start querying data.
This is how the Grafana UI with a custom dashboard looks like:
This is just a bunch of scripts and stuff that I use to get some visibility on single-node server configurations, so please take them as a starting point. For complex architectures and custom instrumentation, extra configuration might be needed.
Also, please note that the node_exporter
is being deployed as a Docker
container, so it might not be exposing metrics from the actual host
system.
Having said that, any feedback is very welcomed πͺ