Best Practices - thanos-io/thanos

Best Practices for Thanos Project

Thanos is a highly available Prometheus setup with long term storage capabilities. The philosophy of Thanos and its community borrows heavily from UNIX philosophy and the Golang programming language. The following best practices are recommended for deploying, managing, and using Thanos effectively.

Design Philosophy

Thanos follows the UNIX philosophy of “do one thing and do it well.” Each subcommand should do one thing and do it well. For example, Thanos query proxies incoming calls to known store API endpoints and merges the result. Components of Thanos should work together, such as blocks being stored in native Prometheus format.

Programming Languages

Thanos is written in the Golang programming language. The following are the official style guides for the various languages used in the Thanos project:

Prometheus

Thanos is a highly available Prometheus setup with long term storage capabilities. It is designed to work with Prometheus and provides additional features such as downsampling, compact storage, and long term storage.

gRPC

Thanos uses gRPC for communication between components. gRPC is a high-performance, open-source universal RPC framework.

Kubernetes

Thanos can be deployed on Kubernetes using the Thanos operator. The Thanos operator simplifies the deployment and management of Thanos components on Kubernetes.

CircleCI, Netlify, GitHub Actions

Thanos can be built and tested using CircleCI, Netlify, or GitHub Actions. These continuous integration and continuous delivery (CI/CD) tools can be used to automate the build, test, and deployment of Thanos.

Slack

Thanos has a Slack channel for community discussions and support. Join the Thanos Slack channel for real-time discussions and support.

CNCF

Thanos is a graduated project of the Cloud Native Computing Foundation (CNCF). The CNCF is an open source software foundation dedicated to making cloud native computing universal and sustainable.

Object Storage

Thanos supports object storage for long term storage. Thanos supports various object storage providers such as Amazon S3, Google Cloud Storage, and Azure Blob Storage.

Deployment Best Practices

The following are the recommended best practices for deploying Thanos:

  • Use the Thanos operator for deploying Thanos on Kubernetes.
  • Use a load balancer for load balancing incoming requests to Thanos query.
  • Use TLS for secure communication between Thanos components.
  • Use object storage for long term storage.

Management Best Practices

The following are the recommended best practices for managing Thanos:

  • Monitor Thanos using Prometheus.
  • Use Grafana for visualizing Thanos metrics.
  • Use the Thanos sidecar for monitoring Thanos components.
  • Use the Thanos ruler for alerting.

Usage Best Practices

The following are the recommended best practices for using Thanos:

  • Use Thanos query for querying Prometheus and long term storage.
  • Use Thanos compact for compacting Prometheus blocks.
  • Use Thanos downsample for downsampling Prometheus blocks.
  • Use Thanos store for storing Prometheus blocks in object storage.

Contributing to Thanos

Thanos welcomes contributions from the community. The following are the recommended best practices for contributing to Thanos:

Resources

Sources: