Aller au contenu

Lyroh Monitoring

Bienvenue dans la documentation de la stack de monitoring Lyroh.

Architecture

┌──────────────────────────────────────────────────────────────────────────┐
│                         SERVEURS APPLICATIONS                            │
├──────────────────────────────────────────────────────────────────────────┤
│  ┌────────────────┐  ┌────────────────┐  ┌────────────────┐              │
│  │ Python Scraper │  │ NestJS Backend │  │ NextJS App x4  │              │
│  │    + Alloy     │  │    + Alloy     │  │    + Alloy     │              │
│  └───────┬────────┘  └───────┬────────┘  └───────┬────────┘              │
└──────────┼───────────────────┼───────────────────┼───────────────────────┘
           │                   │                   │
           └───────────────────┼───────────────────┘
                               │ HTTPS (Basic Auth)
┌──────────────────────────────────────────────────────────────────────────┐
│                    VPS MONITORING (Contabo)                              │
├──────────────────────────────────────────────────────────────────────────┤
│  ┌─────────────────────────────────────────────────────────────────────┐ │
│  │                         TRAEFIK                                      │ │
│  │  grafana.monitoring.lyroh.com → Grafana                              │ │
│  │  loki.monitoring.lyroh.com → Loki (auth)                             │ │
│  │  docs.monitoring.lyroh.com → Documentation                           │ │
│  └─────────────────────────────────────────────────────────────────────┘ │
│                                                                          │
│  ┌────────────────────┐  ┌────────────────────┐  ┌──────────────────┐   │
│  │       LOKI         │  │      GRAFANA       │  │      DOCS        │   │
│  │  - TSDB Index      │◄─│  - Dashboards      │  │  - MkDocs        │   │
│  │  - 7 jours rét.    │  │  - Alertes         │  │  - Cette doc     │   │
│  └────────────────────┘  └────────────────────┘  └──────────────────┘   │
└──────────────────────────────────────────────────────────────────────────┘

Composants

Composant Version URL Description
Grafana 11.4.0 grafana.monitoring.lyroh.com Interface de visualisation
Loki 3.3.2 loki.monitoring.lyroh.com Stockage et indexation des logs
Alloy Latest - Agent de collecte (sur chaque serveur)
Traefik 3.2 - Reverse proxy + SSL

Applications Monitorées

Application Type Label app
Python Scraper Python python-scraper
Backend API NestJS nestjs-backend
Frontend App 1 NextJS nextjs-app-1
Frontend App 2 NextJS nextjs-app-2
Frontend App 3 NextJS nextjs-app-3
Frontend App 4 NextJS nextjs-app-4

Quick Start

1. Déployer le serveur de monitoring

# Sur le VPS Contabo
cd /opt/monitoring
cp .env.example .env
# Éditer .env avec vos valeurs
docker-compose up -d

2. Déployer un agent Alloy

# Sur chaque serveur applicatif
cd /opt/alloy-agent
cp .env.example .env
# Éditer .env avec l'URL Loki et credentials
docker-compose up -d

3. Configurer le CI/CD (GitHub Actions)

Voir le guide complet : CI/CD GitHub Actions

Branche Déploiement
staging VPS Staging
main VPS Production

4. Accéder à Grafana

Ouvrez https://grafana.monitoring.lyroh.com et connectez-vous.

Labels

Les logs sont organisés par ces labels :

Label Description Exemples
app Nom de l'application python-scraper, nestjs-backend
env Environnement prod, staging, dev
host Nom du serveur app-server-1, worker-01
container Nom du container api, worker

Support