本文介绍了Prometheus 中的最大 scrape_interval 是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Prometheus 来衡量业务指标,例如:

I used Prometheus to measure business metrics like:

# HELP items_waiting_total Total number of items in a queue
# TYPE items_waiting_total gauge
items_waiting_total 149

我想长期保留这些数据(保留 5 年),并且我不需要在 scrape_interval 中使用高频率.所以我设置了scrape_interval: "900s".

I would like to keep this data for very long term (5 years retention) and I don't need high frequency in scrape_interval. So I set up scrape_interval: "900s".

当我在 Prometheus 中以 60 秒的分辨率查看图形时,它显示了扑动,但事实并非如此.

When I check the graph in Prometheus with 60s resolution, it shows that flapping, but it is not true.

问题是,Prometheus 中的最大(推荐)scrape_interval 是多少?

The question is, what is the maximum (recommended) scrape_interval in Prometheus?

推荐答案

最好不要超过 2 分钟.这是因为默认情况下过时是 5 分钟(这就是造成间隙的原因),并且您希望允许刮擦失败.

It's not advisable to go above about 2 minutes. This is as staleness is 5 minutes by default (which is what's causing the gaps), and you want to allow for a failed scrape.

这篇关于Prometheus 中的最大 scrape_interval 是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 00:27