真正解决prometheus Error on ingesting samples that are too old or are too far into the future的问题

真正解决prometheus Error on ingesting samples that are too old or are too far into the future的问题

看了很多国内的论坛,完全在误导,不去看清问题真相

一、问题引出

突然有天就数据查询失败,异常如下

level=warn ts=2020-10-09T02:29:06.700Z caller=scrape.go:1216 component="scrape manager" scrape_pool=service.server target=http://192.168.1.22:9100/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=929
level=warn ts=2020-10-09T02:29:06.700Z caller=scrape.go:987 component="scrape manager" scrape_pool=service.server target=http://192.168.1.22:9100/metrics msg="appending scrape report failed" err="out of bounds"

二、什么原因呢

ts=2020-10-09T02:29:06.700Z,有博客说可以看到日志的时间戳与当前时间戳提前了8个小时,其实并不是提前了8小时,看到个8就知道是时区问题,UTC时间就这样。
但是还必须得用UTC,什么原因官方说夏令时时间有误差,还是不太懂,反正就必须用UTC,但其实用了UTC也并不影响我们数据保存和读取
这里真正的原因是,可能你的系统有断电导致时间重置了,或者有往前改过系统时间,prometheus在同一时间点记录了不同的数据

三、如何解决?

那还能怎样?删数据呗,但我认为不能完全解决问题,等完美解决我再在下面更新!
具体就是删除prometheus底下的data目录里面的数据

昨天晚上发现是运维人员打包的时候,把其他服务器上的data目录下的数据也一并复制到了另一台服务器下,于是就发生了这类问题。所以还是老办法,删除data目录,以后再复现再回来分析i

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值