thanos-io/thanos

GitHub: thanos-io/thanos

Thanos 是 CNCF 孵化项目,为 Prometheus 提供高可用、无限期长期存储和全局查询能力的开源监控指标扩展方案。

Stars: 14108 | Forks: 2317

Thanos Logo

[![最新发布](https://img.shields.io/github/release/thanos-io/thanos.svg?style=flat-square)](https://github.com/thanos-io/thanos/releases/latest) [![Go Report Card](https://goreportcard.com/badge/github.com/thanos-io/thanos)](https://goreportcard.com/report/github.com/thanos-io/thanos) [![Go 代码参考](https://img.shields.io/badge/code%20reference-go.dev-darkblue.svg)](https://pkg.go.dev/github.com/thanos-io/thanos?tab=subdirectories) [![Slack](https://img.shields.io/badge/join%20slack-%23thanos-brightgreen.svg)](https://slack.cncf.io/) [![Netlify 状态](https://api.netlify.com/api/v1/badges/664a5091-934c-4b0e-a7b6-bc12f822a590/deploy-status)](https://app.netlify.com/sites/thanos-io/deploys) [![CII 最佳实践](https://bestpractices.coreinfrastructure.org/projects/3048/badge)](https://bestpractices.coreinfrastructure.org/projects/3048) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5715ccf24b201038.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3ACI) [![CI](https://circleci.com/gh/thanos-io/thanos.svg?style=svg)](https://circleci.com/gh/thanos-io/thanos) [![go](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/fdba6b1194201042.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3Ago) [![react](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/b1b51137b9201044.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3Areact) [![docs](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/30205c2849201046.svg)](https://github.com/thanos-io/thanos/actions?query=workflow%3Adocs) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/thanos-io/thanos) [![在 GitHub Codespaces 中打开](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5b8095d27d201050.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=109162639) ## 概述 Thanos 是一组组件,可以组合成一个具有无限存储容量且高可用的 metric 系统,并且可以无缝添加到现有的 Prometheus 部署之上。 Thanos 是一个 [CNCF](https://www.cncf.io/) 孵化项目。 Thanos 利用 Prometheus 2.0 存储格式,将历史 metric 数据高性价比地存储在任何 object storage 中,同时保持快速的查询延迟。此外,它提供了跨所有 Prometheus 安装的全局查询视图,并能即时合并来自 Prometheus HA 对的数据。 具体而言,该项目的目标是: 1. metric 的全局查询视图。 2. metric 的无限保留。 3. 组件(包括 Prometheus)的高可用性。 ## 快速开始 * **[快速开始](https://thanos.io/tip/thanos/getting-started.md/)** * [设计](https://thanos.io/tip/thanos/design.md/) * [博客文章](docs/getting-started.md#blog-posts) * [演讲](docs/getting-started.md#talks) * [提案](docs/proposals-done) * [集成](docs/integrations.md) ## 功能 * 跨所有已连接的 Prometheus 服务器的全局查询视图 * 对从 Prometheus HA 对收集的 metric 进行去重和合并 * 与现有 Prometheus 设置的无缝集成 * 任何 object storage 作为其唯一的、可选的依赖项 * 对历史数据进行 Downsampling 以大幅提升查询速度 * 跨集群的联邦查询 * 容错查询路由 * 简单的 gRPC "Store API",用于跨所有 metric 数据的统一数据访问 * 为自定义 metric 提供者提供简单的集成点 ## 架构概述 带有 Sidecar 的 Kubernetes 部署: