RousselTMLEARNING

Observability

Operating Thanos: monitoring, performance, troubleshooting and alternatives

Thanos operating best practices: key metrics and alerts, mixin, caches, limits, frequent errors and comparison with Mimir, Cortex and VictoriaMetrics.

1. Monitoring Thanos #

The essential signals.

Key metrics and alerts #

ComponentMetricAlert if...
Sidecarthanos_shipper_uploads_failed_totalIncreasing
Sidecarthanos_sidecar_prometheus_up= 0
Querythanos_store_nodes_grpc_connectionsFewer stores than expected
Querygrpc_server_handled_total{grpc_code!="OK"}High error rate
Storethanos_bucket_store_series_blocks_queriedVery high (expensive queries)
Compactorthanos_compact_halted= 1
Compactorthanos_compact_todo_compactionsGrowing endlessly
Rulerprometheus_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. Performance #

Fast queries over long periods.

Downsampling and caches #

Points read depending on resolution
With --query.auto-downsampling, Query picks the resolution suited to the graph step.
# 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: 10000
Good practice: Use recording rules for heavy dashboard queries: the Ruler or Prometheus precomputes them, which avoids reading large historical volumes at each refresh.

3. Troubleshooting #

Frequent errors.

Diagnostic table #

SymptomLikely causeAction
No blocks in the bucketLocal compaction enabled or sidecar without access to the TSDBCheck the 2h block flags and the shared volume
Duplicate series in GrafanaReplica label not configuredAdd --query.replica-label
« expanding series: context deadline exceeded »Query too broadReduce the range, use downsampling, increase timeouts
Missing data over a periodStore Gateway not up to date or --min-time too recentCheck thanos_blocks_meta_synced
Compactor haltedOverlapping / corrupted blocksthanos tools bucket verify --repair after analysis
High store memory usageToo many series returnedLimit --store.limits.request-series and add 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 error

4. Thanos versus the alternatives #

Making an informed choice.

Comparison #

SolutionModelStrengthsPoints of attention
ThanosComponents around Prometheus (sidecar / receive)Gradual adoption, simple, CNCF communitySeveral components to operate
Grafana MimirDistributed multi-tenant TSDB (remote write)Very large scale, performance, ease of useReplaces local storage, more resources
CortexMimir's ancestorProvenMimir is its recommended successor
VictoriaMetricsIndependent PromQL-compatible TSDBVery resource-efficientDifferent ecosystem and licenses
Good practice: Thanos is ideal if you already have Prometheus servers to keep and want to add retention, HA and a global view without migrating everything. For a very large-scale multi-tenant platform, evaluate Mimir.

Related articles

Thanos: extending Prometheus (high availability, global view and long retention)

Understand why and how to use Thanos: Prometheus limits, components (Sidecar, Query, Store Gateway, Compactor…

Thanos Sidecar: attaching Thanos to Prometheus and uploading to object storage

Set up Thanos Sidecar: Prometheus settings (external labels, 2h blocks), objstore configuration, Docker Compo…

Thanos Query and Query Frontend: a global, deduplicated view

Configure Thanos Query: StoreAPI endpoints, deduplication by replica label, partial response, web interface, …

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!