View Source Code on GitHub
SERVER / VPS HOST
  • OS: Linux (Ubuntu/Debian/CentOS)
  • Runtime: Docker + Docker Compose
  • Containers: Application workloads

The Monitored Infrastructure

The server hosts your containerized applications. All monitoring components run as Docker containers alongside your workloads, collecting metrics from both the host system and running containers.

NODE EXPORTER :9100
Host Metrics:
CPU, Memory, Disk, Network

Host Metrics Collector

Node Exporter exposes hardware and OS metrics from the host machine. It reads from /proc and /sys filesystems to gather system-level statistics.

  • CPU usage per core
  • Memory and swap usage
  • Disk I/O and space
  • Network interface stats
(Exposes /metrics endpoint)
cADVISOR :8080
Container Metrics:
Per-container resources

Container Metrics Collector

cAdvisor (Container Advisor) provides container users an understanding of the resource usage and performance characteristics of their running containers.

  • Container CPU usage
  • Container memory limits
  • Container network I/O
  • Container filesystem usage
(Monitors Docker daemon)
(Prometheus scrapes every 15s)
PROMETHEUS :9090
Core Functions:
  • Scrape: Pull metrics from exporters
  • Store: Time-series database (TSDB)
  • Query: PromQL for data analysis
  • Alert: Evaluate rules, send to Alertmanager

→ View prometheus.yml config

Metrics Storage & Processing

Prometheus is the central component that scrapes metrics from all exporters, stores them in a time-series database, and evaluates alerting rules. It uses a pull-based model, fetching metrics at regular intervals.

(Fires alerts)
ALERTMANAGER :9093
Alert Routing:
Groups, deduplicates, routes alerts

→ View alertmanager.yml

Alert Management

Alertmanager handles alerts sent by Prometheus. It deduplicates, groups, and routes them to the correct receiver (email, Slack, PagerDuty, etc.).

  • Alert grouping by labels
  • Silence and inhibition rules
  • Multiple notification channels
  • Alert history tracking
EMAIL NOTIFICATION
Alert: High CPU Usage!
Sent to ops team
(Queries data)
GRAFANA :3001
Visualization:
Dashboards, graphs, panels

→ View provisioning config

Metrics Visualization

Grafana provides beautiful dashboards for visualizing metrics. It queries Prometheus using PromQL and displays data in various chart formats.

  • Pre-built dashboards
  • Custom panel creation
  • Variable templating
  • Dashboard sharing
OPERATIONS TEAM
Views real-time dashboards
at http://server:3001
DOCKER COMPOSE

All services defined in a single compose file:

services:
prometheus: # :9090
grafana: # :3001
alertmanager: # :9093
cadvisor: # :8080
node-exporter: # :9100

→ View docker-compose.yml

One Command Deployment

The entire monitoring stack is deployed with a single command: docker-compose up -d. All services are pre-configured to work together out of the box.

QUICK START
# Clone the repository
git clone https://github.com/chihi2000/VPS-MONITORING-GUIDE.git

# Start the stack
cd VPS-MONITORING-GUIDE
docker-compose up -d

Access Grafana at http://your-server:3001