Loki sert son API en HTTPS via le cert step-ca (http_tls_config + cert-sync owned loki, motif .path). Alloy pousse en https + tls_config (ca=root_ca). Vars : serveur_loki_tls_actif, client_journal_loki_tls. Prouvé : Loki HTTPS /ready 200 (vérif root_ca), HTTP rejeté (400), 4 hôtes expédient des logs en https, 0 erreur loki.write après la transition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| defaults | ||
| handlers | ||
| tasks | ||
| templates | ||
| README.md | ||
client_journal
Intégration cliente journaux : expédie le journal système (journald) de la VM
vers serveur_loki, via Grafana Alloy.
Rôle
- Ajoute le dépôt apt Grafana et installe
alloy. - Ajoute l'utilisateur
alloyau groupesystemd-journal(lecture du journal). - Déploie
/etc/alloy/config.alloy:loki.source.journal→loki.writevers Loki.
Boucle
VM dans client_journal → Alloy lit journald → pousse vers Loki (obs-01) →
visible dans Grafana (datasource Loki).
Variables
| Variable | Défaut | Rôle |
|---|---|---|
client_journal_loki_url |
http://10.0.14.11:3100/loki/api/v1/push |
Endpoint Loki (obs-01) |
Notes / limites
- La syntaxe de configuration Alloy évolue entre versions ; la config fournie
cible un Alloy récent (
loki.source.journal,loki.write). Ajustement mineur possible selon la version installée. - Étiquettes par défaut :
job=systemd-journal,host=<inventory_hostname>.
Prérequis
- Dépendance
client_journal requiert serveur_loki actif(déjà dansdocs/dependances-groupes.yml).