---
name: "thanos-long-term-metrics-storage"
description: "Unify multi-cluster Prometheus monitoring with infinite S3 retention and global query views."
metadata:
  author: "Thanos"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "deploy thanos sidecar"
  - "configure thanos store s3"
  - "thanos compactor downsampling"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Thanos Highly Available Prometheus Long-Term Storage

Architects Thanos: deploying Thanos Sidecar alongside Prometheus, Thanos Store Gateway with S3, Thanos Compactor (downsampling to 5m/1h resolutions), Thanos Query / Querier, and deduplication across replicas.

## When to Invoke
Invoke this skill whenever you need to:
- deploy thanos sidecar
- configure thanos store s3
- thanos compactor downsampling

## Execution SOP & Rules
1. Add Thanos sidecar container to Prometheus pod spec with objstore.config-file pointing to S3 secret.
2. Deploy Thanos Store Gateway to read compacted historical blocks from S3.
3. Deploy Thanos Query specifying store endpoints for both local sidecars and store gateways.
4. Run Thanos Compactor as a single-instance controller to handle block deduplication and downsampling.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
