last_over_time()和实例向量有什么区别?

发布于 2025-02-05 20:23:11 字数 193 浏览 2 评论 0原文

last_over_time(metric {} [1H])返回最新的(最新)样本在1小时内设置(现在-1小时) 公制{} Instant向量返回样本集的最新(最新)样本。

这些样本是平等的,我错了吗?

何时使用last_over_time,而只是即时向量?

last_over_time(metric{}[1h]) returns the latest (recent) sample of samples' set in 1 hour (now - 1 hour)
metric{} instant vector returns the latest (recent) sample of samples' set.

These samples would be equal, am I wrong?

When to use the last_over_time and just instant vector?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栖竹 2025-02-12 20:23:12

如果最新样本和请求的时间戳之间的距离超过5分钟,则Prometheus停止返回时间序列。如果存在这些样品之后,如果存在陈旧的标记,它也可能停止返回的系列,并参见这些文档

因此,基本上,metric_name查询在某种程度上等于last_over_time(metric_name [5M])。如果所请求的系列包含过时的标记,这些查询可能会返回不同的结果。

Prometheus stops returning time series if the distance between the latest sample and the requested timestamp exceeds 5 minutes by default. It may also stop returning series with more recent samples if there are staleness markers exist after these samples - see these docs for details.

So, basically, metric_name query is somewhat equivalent to last_over_time(metric_name[5m]). These queries may return different results if the requested series contain stale markers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文