openGemini icon indicating copy to clipboard operation
openGemini copied to clipboard

【prometheus远程读写】只能查询到time为几天前的数据,无法查到time是最近时间的数据

Open xiaoliang-liu opened this issue 1 year ago • 1 comments

Describe the bug(Bug 描述)

我使用的是【prometheus远程读写】功能,在使用prometheus连接到openGemini后,使用SQL向openGemini中插入2条数据,接着在prometheus自带的web ui中查询数据,只能查询到一条数据,不符合预期。

To Reproduce(Bug 复现步骤)

  1. 我使用prometheus连接openGemini上;
  2. 使用SQL语句 INSERT device1,__name__=device1,instance=localhost:9090,job=prometheus value=220.32 1727148666580000000和INSERT device1,__name__=device1,instance=localhost:9090,job=prometheus value=221.32 1726803355000000000插入两条数据;
  3. 在prometheus自带的web ui中查询数据,只能查询到一条时间较远的数据;

Expected behavior(期望结果)

查询到两条数据

Screenshots(屏幕截图)

image image image

配置信息 image image image image

Logs(完整的错误日志)

No response

Additional context(其他的一些补充内容)

版本

  1. openGemini1.2.0和openGemini1.3.0都尝试过;
  2. prometheus-2.53.2和prometheus-2.54.1都尝试过;

xiaoliang-liu avatar Sep 24 '24 04:09 xiaoliang-liu

try change tsdb rotation to a very low value like 5m in prometheus's config?

fly3366 avatar Sep 27 '24 02:09 fly3366

Thank you very much for your feedback. When reproducing the problem, pay attention to the prom query time range. device1[10d] indicates the time range from now-10d to now. Check whether the data points that are not queried are within the time range. Currently, promql is supported. You'd better use promql to query openGemini for better performance.

MrSanZhi avatar Oct 09 '24 10:10 MrSanZhi