This article is available in French.
1. Superviser Thanos #
Les signaux indispensables.
Métriques et alertes clés #
| Composant | Métrique | Alerte si... |
|---|---|---|
| Sidecar | thanos_shipper_uploads_failed_total | En augmentation |
| Sidecar | thanos_sidecar_prometheus_up | = 0 |
| Query | thanos_store_nodes_grpc_connections | Moins de stores qu'attendu |
| Query | grpc_server_handled_total{grpc_code!="OK"} | Taux d'erreurs élevé |
| Store | thanos_bucket_store_series_blocks_queried | Très élevé (requêtes coûteuses) |
| Compactor | thanos_compact_halted | = 1 |
| Compactor | thanos_compact_todo_compactions | Croissant sans fin |
| Ruler | prometheus_rule_evaluation_failures_total | > 0 |
# Dashboards et alertes officiels
git clone https://github.com/thanos-io/thanos && cd thanos/mixin
jb install && make build
# Alertes minimales
- alert: ThanosCompactHalted
expr: thanos_compact_halted == 1
for: 5m
labels: { severity: critical }
- alert: ThanosSidecarNoUpload
expr: increase(thanos_shipper_uploads_total[6h]) == 0
for: 30m
labels: { severity: warning }2. Performances #
Requêtes rapides sur de longues périodes.
Downsampling et caches #
--query.auto-downsampling, Query choisit la résolution adaptée au pas du graphe.# Query : résolution automatique + limites de protection
thanos query --query.auto-downsampling --query.max-concurrent=20 --query.timeout=2m \
--store.response-timeout=30s --query.default-evaluation-interval=1m
# Store : caches
thanos store --index-cache.config-file=index-cache.yml --store.caching-bucket.config-file=caching-bucket.yml
# index-cache.yml
type: MEMCACHED
config:
addresses: [memcached:11211]
max_async_buffer_size: 10000Bonne Pratique : Utilisez des recording rules pour les requêtes de dashboard lourdes : le Ruler ou Prometheus les précalcule, ce qui évite de lire de gros volumes historiques à chaque affichage.
3. Dépannage #
Les erreurs fréquentes.
Tableau de diagnostic #
| Symptôme | Cause probable | Action |
|---|---|---|
| Pas de blocs dans le bucket | Compaction locale active ou sidecar sans accès au TSDB | Vérifier les flags de blocs 2 h et le volume partagé |
| Séries dupliquées dans Grafana | Replica label non configuré | Ajouter --query.replica-label |
| « expanding series: context deadline exceeded » | Requête trop large | Réduire la plage, utiliser le downsampling, augmenter les timeouts |
| Données manquantes sur une période | Store Gateway pas à jour ou --min-time trop récent | Vérifier thanos_blocks_meta_synced |
| Compactor arrêté (halted) | Blocs qui se chevauchent / corrompus | thanos tools bucket verify --repair après analyse |
| Utilisation mémoire élevée du store | Trop de séries retournées | Limiter --store.limits.request-series et ajouter du cache |
thanos tools bucket verify --objstore.config-file=bucket.yml --issues=overlapped_blocks,index_known_issues
curl -s localhost:10902/-/healthy; curl -s localhost:10902/-/ready
journalctl -u thanos-compact -n 100 --no-pager | grep -i error4. Thanos face aux alternatives #
Choisir en connaissance de cause.
Comparatif #
| Solution | Modèle | Points forts | Points d'attention |
|---|---|---|---|
| Thanos | Composants autour de Prometheus (sidecar / receive) | Adoption progressive, simple, communauté CNCF | Plusieurs composants à opérer |
| Grafana Mimir | TSDB distribuée multi-tenant (remote write) | Très grande échelle, performances, simplicité d'usage | Remplace le stockage local, plus de ressources |
| Cortex | Ancêtre de Mimir | Éprouvé | Mimir est son successeur recommandé |
| VictoriaMetrics | TSDB indépendante compatible PromQL | Très économe en ressources | Écosystème et licences différents |
Bonne Pratique : Thanos est idéal si vous avez déjà des Prometheus à conserver et voulez ajouter rétention, HA et vue globale sans tout migrer. Pour une plateforme multi-tenant à très grande échelle, évaluez Mimir.
My progress
Sign in to track your progress and take notes. Sign in
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 ...