10

Prometheus 集群方案之 Thanos

 3 years ago
source link: https://liqiang.io/post/thanos-for-prometheus-ha-5e3e69e3?lang=ZH_CN
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

All Posts

Prometheus 集群方案之 Thanos

@POST· 2021-09-05 12:43 · 7 min read

Thanos 这种对 Prometheus 扩展的方式其实已经边缘化了 Prometheus,而是将 Prometheus 作为一个数据的入口,并且兼容 Prometheus 的 PromQL,Recording Rule 和报警规则(这其实也是我们当初最开始的时候考虑过的一种场景,就是当发现 Prometheus 不够好用时,我们可以只使用他的协议,自己实现内部逻辑)。

  • 只有 Metrics 采集和部分报警触发功能是 prometheus 来完成;
  • Thanos 使用 Prometheus 存储格式,把历史数据压缩保存到对象存储里
  • Thanos 提供全局查询视图
  • Thanos 执行全局的报警触发功能
图 1:Thanos 架构图 cd994835-ecfe-4fca-8d15-d5b969b9e132.png
  • Sidecar:连接 Prometheus,并把 Prometheus 暴露给 Query 组建,也可以选择将数据上传到云存储;
  • Store Gateway:访问放在云存储中的 metrics;
  • Compactor:压缩采样以及清理云存储中的数据;
  • Receiver:接收 Prometheus remote-write WAL 的数据,用于暴露或者上传到云存储;
  • Ruler/Rule:使用 Thanos 中的数据执行 Recoring 和 Alerting Rule,用于展示或者上传到云存储;
  • Querier/Query:实现 Prometheus v1 API,汇集底层组件的数据;
  • 解决了单点故障的问题
  • 解决了单点性能瓶颈的问题(支持水平扩展)
  • 存储和执行引擎分离
  • 组件繁多,运维复杂度高
  • 依赖对象存储(额外的存储系统,可接受)
  • 外部存储使用的还是 Prometheus 的数据格式,不利于做数据分析
© 2012-2020 路人的技术 版权所有. Powered by LauZoo. Theme based on Nuo.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK