33800 Docs

← Retour

Backlog: API Health Standardisee pour tous les projets

Date: 26/01/2026 Priorite: MOYENNE Status: A FAIRE

Contexte

Besoin d'un endpoint /health ou /status standardise sur TOUS les projets pour:

Specification

Endpoint standard

GET /health
GET /_health  (alternative)
GET /api/health (pour APIs)

Response JSON standardisee

{
  "status": "ok|degraded|error",
  "service": "nom-du-service",
  "version": "1.2.3",
  "git_commit": "abc1234",
  "build_date": "2026-01-26T22:00:00Z",
  "uptime_seconds": 3600,
  "environment": "production|staging|dev",

  "dependencies": {
    "database": { "status": "ok", "latency_ms": 5 },
    "redis": { "status": "ok", "latency_ms": 2 },
    "external_api": { "status": "degraded", "error": "timeout" }
  },

  "resources": {
    "memory_mb": 256,
    "cpu_percent": 15,
    "disk_percent": 45,
    "connections": 12
  },

  "metrics": {
    "requests_total": 150000,
    "requests_per_minute": 120,
    "errors_last_hour": 3
  }
}

Securite

IMPORTANT: Accessible uniquement depuis le reseau prive

Options:

  1. Nginx: Restreindre par IP source (192.168.1.0/24, 10.10.10.0/24)
  2. Header secret: X-Health-Token
  3. Port separe: Health sur port interne uniquement (ex: 9090)

Exemple nginx:

location /health {
    allow 192.168.1.0/24;
    allow 10.10.10.0/24;
    deny all;
    proxy_pass http://backend/health;
}

Projets a mettre a jour

Projet Stack Status actuel
connectors-api Bun/Elysia /health existe (basique)
connectors-front Qwik A ajouter
dashboard-33800 Static N/A
gitlab GitLab CE /-/health existe
supabase Supabase /health existe
nginx Nginx stub_status
portainer Portainer /api/status
jellyfin Jellyfin /health
ai-orchestrator ? A verifier
browser-connector ? A verifier

Dashboard de monitoring

Fonctionnalites

  1. Liste des services avec statut live (vert/orange/rouge)
  2. Versions deployees vs attendues
  3. Uptime de chaque service
  4. Alertes si degradation detectee
  5. Historique des changements de version

Implementation

Options:

Exemple UI

┌─────────────────────────────────────────────────────────────┐
│  INFRASTRUCTURE STATUS                    Last check: 5s ago │
├─────────────────────────────────────────────────────────────┤
│  ● connectors-api      v2.5.0    OK      uptime: 3d 5h      │
│  ● connectors-front    v1.2.0    OK      uptime: 1d 2h      │
│  ● gitlab              16.8.0    OK      uptime: 15d        │
│  ◐ supabase-api        2.0.0     SLOW    latency: 234ms     │
│  ○ ai-orchestrator     -         DOWN    since: 10min       │
└─────────────────────────────────────────────────────────────┘

Implementation

Phase 1: Standardiser /health existants

Phase 2: Ajouter aux projets manquants

Phase 3: Dashboard monitoring

Phase 4: Alerting

Variables d'environnement a injecter (CI/CD)

# Dans .gitlab-ci.yml
variables:
  APP_VERSION: $CI_COMMIT_TAG
  GIT_COMMIT: $CI_COMMIT_SHORT_SHA
  BUILD_DATE: $(date -u +%Y-%m-%dT%H:%M:%SZ)

Ressources