gpt4 book ai didi

scrape_interval 的 Prometheus 设置

转载 作者:行者123 更新时间:2023-12-04 10:14:38 25 4
gpt4 key购买 nike

我正在尝试使用 Prometheus 和 VictoriaMetrics 来收集数据,并且在配置我的服务器 prometheus.yml 时有一行:

scrape_interval: 15s  # How frequently to scrape targets by default.

这是否意味着我的搜索结果可能会延迟 15 秒?

最佳答案

是的,这意味着在最坏的情况下,您的指标将在 15 秒后到达。您可以将其配置为更快。
<duration>: a duration matching the regular expression [0-9]+(ms|[smhdwy])
以上来自 Prometheus 文档:https://prometheus.io/docs/prometheus/latest/configuration/configuration/#duration

通常,将其视为 Prometheus 对您的(连续)指标的外观(CPU 使用情况、正在运行的线程数等)进行快照,而不是将 Prometheus 视为收集离散事件的地方。

当您考虑触发警报需要多长时间或数据可见时,抓取间隔是一个需要牢记的因素。

在警报的上下文中,这篇文章是一个很好的资源:https://pracucci.com/prometheus-understanding-the-delays-on-alerting.html

它基本上说,如果您的抓取间隔是 x时间单位,只有当 y 的表达式为真时才会触发警报时间单位,那么延迟在最坏的情况下可能是 (x + y) 个时间单位。

关于scrape_interval 的 Prometheus 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61137522/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com