普罗米修斯监控采集看不到数据,报错:
prometheus[19238]: ts=2024-07-02T09:13:01.932Z caller=scrape.go:1604 level=warn component="scrape manager" scrape_pool=prometheus target=http://localhost:9090/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=800
原因是普罗米修斯服务器时间不同步或者长时间未开机,数据库数据太旧造成,需要同步相关服务器时间,删除普罗米修斯服务器数据即可。
vi /usr/lib/systemd/system/prometheus.service
本文的数据库位置在/var/lib/prometheus
删除即可
cd /var/lib/prometheus
rm -rf *
systemctl restart prometheus