D9.1 Monitoring Philosophy για Docker 📊

Τι παρακολουθείς;

4 Golden Signals (Google SRE):
│
├── Latency    → Πόσο αργά απαντά;
│               (p50, p95, p99 response times)
│
├── Traffic    → Πόσα requests;
│               (req/sec, connections/sec)
│
├── Errors     → Πόσα errors;
│               (HTTP 5xx rate, failed tasks)
│
└── Saturation → Πόσο γεμάτο;
    (CPU %, RAM %, disk I/O, connections)

Για Docker containers:
├── Container: CPU, RAM, network I/O, disk I/O
├── Host:      Load, disk space, network
└── App:       Response time, error rate, throughput

Stack αρχιτεκτονική

Monitoring Stack:

  ┌─────────────────────────────────────────────────┐
  │  Managed Hosts                                  │
  │  ┌──────────────┐  ┌──────────────┐             │
  │  │ node_exporter│  │   cAdvisor   │             │
  │  │ :9100        │  │   :8080      │             │
  │  │ (host metrics)│  │(container   │             │
  │  └──────┬───────┘  │  metrics)   │             │
  │         │          └──────┬───────┘             │
  └─────────┼────────────────┼─────────────────────┘
            │   Pull metrics  │
            ▼                 ▼
  ┌──────────────────────────────────────────────┐
  │  Monitoring Server                           │
  │                                              │
  │  ┌─────────────┐  ┌──────────────────────┐  │
  │  │ Prometheus  │  │    Alertmanager      │  │
  │  │ :9090       │──│    :9093             │  │
  │  │ (scrape +   │  │  (routing alerts)   │  │
  │  │  storage)   │  └──────────────────────┘  │
  │  └──────┬──────┘                            │
  │         │                                   │
  │  ┌──────▼──────┐                            │
  │  │  Grafana    │                            │
  │  │  :3000      │                            │
  │  │  (dashboards│                            │
  │  └─────────────┘                            │
  └──────────────────────────────────────────────┘

Pull vs Push model

Pull model (Prometheus):
  Prometheus ──► scrape ──► node_exporter
  Πλεονεκτήματα:
  ✅ Centralized control
  ✅ Εύκολο service discovery
  ✅ Εύκολο να δεις αν host είναι down

Push model (Telegraf, StatsD):
  Container ──► push ──► InfluxDB
  Πλεονεκτήματα:
  ✅ Firewall-friendly (outbound μόνο)
  ✅ Short-lived containers

→ Χρησιμοποιούμε Pull (Prometheus)
  για static infrastructure

Σύνοψη D9.1

Monitoring Philosophy
│
├── 4 Golden Signals: Latency, Traffic, Errors, Saturation
├── Stack: node_exporter → Prometheus → Grafana
├── Alerts: Prometheus rules → Alertmanager → Slack/Email
└── Pull model: Prometheus scrapes exporters