Back to tutorials
Prometheus + Grafana monitoring stack
This tutorial covers the complete deployment of a monitoring stack with Prometheus for metrics collection, Grafana for visualization, Node Exporter for system metrics and Alertmanager for notifications. By the end of this guide, you will have a working monitoring infrastructure capable of monitoring your servers and alerting you when something goes wrong.
Prerequisites
- Operating system: Debian 12+ or Ubuntu 22.04+ (the commands can be adapted to CentOS/RHEL)
- Privileges: Root or sudo access on the monitoring server
- Resources: Minimum 2 GB of RAM and 20 GB of disk space (adjust according to the number of targets)
- Network: Ports 9090 (Prometheus), 9100 (Node Exporter), 3000 (Grafana), 9093 (Alertmanager) accessible
- Knowledge: Basics of Linux administration and systemd service management
Stack architecture
Prometheus works on a pull model: it is the Prometheus server that periodically queries the targets to retrieve their metrics. This model has several advantages over push (StatsD/Graphite style):
- Prometheus: Central server that scrapes metrics over HTTP, stores them locally as time series and evaluates alerting rules
- Exporters: Lightweight agents that expose metrics in the Prometheus format on a
/metrics endpoint. The most common is node_exporter for system metrics
- Grafana: Visualization interface that connects to Prometheus as a data source to create interactive dashboards
- Alertmanager: Component that receives the alerts fired by Prometheus, deduplicates them, groups them and routes them to the right recipients (email, Slack, PagerDuty)
+------------------+ +-------------------+ +------------------+
| Node Exporter | <---- | Prometheus | ----> | Alertmanager |
| (port 9100) | | (port 9090) | | (port 9093) |
+------------------+ +-------------------+ +------------------+
|
v
+-------------------+
| Grafana |
| (port 3000) |
+-------------------+
Premium Content
This advanced tutorial is reserved for premium members.
9,90€ / month
- All advanced tutorials
- New content every week
- Progress tracking
- Cancel anytime
Comments