RousselTMLEARNING

Article · Fluent Bit and Vector: lightweight log collection

Log collection best practices

This article is available in French.

1. À la source #

Moins de bruit, plus de structure.

Principes #

  • Logs applicatifs en JSON : moins d'analyse fragile par regex.
  • Filtrer tôt (health checks, debug) : chaque ligne coûte en réseau, stockage et requêtes.
  • Masquer les données personnelles et secrets dans le collecteur.
  • Gérer le multiligne (exceptions) avant tout autre traitement.

2. Fiabilité #

Ne rien perdre sans tout saturer.

Réglages #

  • Tampon disque sur les agents de production, avec une taille maximale.
  • Positions de lecture persistantes (db pour Fluent Bit, data_dir pour Vector).
  • Limites mémoire et requêtes de ressources dans le DaemonSet.
  • Alertes sur les erreurs d'envoi et les tampons pleins.

3. Destinations et coûts #

Labels et volumes.

Règles #

  • Pour Loki : peu de labels, à faible cardinalité (namespace, application, niveau) ; le reste dans le contenu.
  • Pour Elasticsearch : un schéma de champs cohérent (ECS par exemple).
  • Archiver à bas coût (S3) ce qui doit être conservé longtemps sans être interrogé.
  • Configuration versionnée, validée et testée en CI.

Schéma de référence et vérification rapide #

Check-list.

Check-list #

  1. Agent en DaemonSet avec limites
  2. Multiligne géré
  3. Masquage des données sensibles
  4. Tampon disque activé
  5. Métriques de l'agent dans Prometheus
  6. Tests de configuration en CI

📄 Bonnes pratiques de collecte de logs avec Fluent Bit et Vector →

My progress

  • ⏱ Estimated time : ≈ 4 min

Sign in to track your progress and take notes. Sign in

✉️ Ask a question

Recommended Articles

Understanding the concept of score

The concept of score allows Elasticsearch to rank your documents by relevance during a search.

Understanding the Elastic Common Schema (ECS)

As always in our consulting engagements, we recommend that companies harmonise and standardise: k...

License consumption types

Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...

Grafana Alloy: The importance of Self-Monitoring

Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...

Grafana Alloy: Understanding and exploiting the User Interface (UI)

Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...

Grafana Alloy: Introduction and Architecture

Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...

Grafana Alloy: Syntax and Configuration (Alloy Language: River)

As part of a Grafana training or observability training, master the declarative syntax of Grafana...

Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)

Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...

Grafana Alloy: Log Management with Loki

Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...