last_over_time()和实例向量有什么区别?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果最新样本和请求的时间戳之间的距离超过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 tolast_over_time(metric_name[5m])
. These queries may return different results if the requested series contain stale markers.