momo's Blog.

Prometheus强制Remote Read每次都从远程存储读取数据

字数统计: 164阅读时长: 1 min
2022/02/11 Share

前言

使用了阿里云的SLS 存储时序数据, 告警则用 Remote read 进行处理。 不过在使用的时候发生了怪事,每次当Prometheus Write tsdb trunk 的时, Prometheus就会默认从本地去检索数据。

问题就出现在本地检索数据, 完全没有数据他怎么检索。

解决

1
2
3
remote_read:
- url: "https://xxxxxxxxxxxx.com/api/prom_read"
read_recent: true

“read_recent: true”表示近期数据也要读远程存储。因为Prometheus近期数据无论如何都是要读本地存储的,如果开启这个标志位,Prometheus会把本地和远程的数据进行Merge。

参考文档

CATALOG
  1. 1. 前言
  2. 2. 解决
  3. 3. 参考文档