【发布时间】:2020-04-10 09:32:37
【问题描述】:
我正在尝试使用 Prometheus 和 VictoriaMetrics 来收集数据,并且在配置我的服务器 prometheus.yml 时有一行:
scrape_interval: 15s # How frequently to scrape targets by default.
这是否意味着我的搜索结果可能会延迟 15 秒?
【问题讨论】:
标签: prometheus victoriametrics
我正在尝试使用 Prometheus 和 VictoriaMetrics 来收集数据,并且在配置我的服务器 prometheus.yml 时有一行:
scrape_interval: 15s # How frequently to scrape targets by default.
这是否意味着我的搜索结果可能会延迟 15 秒?
【问题讨论】:
标签: prometheus victoriametrics
是的,这意味着在最坏的情况下,您的指标将在 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) 时间单位.
【讨论】: