是否可以计算指标等级?

发布于 2025-02-06 12:19:09 字数 318 浏览 1 评论 0原文

我是否缺少某些内容,或者在Promql中没有任何功能来计算以下任一项:
  • 在同一度量的先前观察结果中,度量的等级
  • 以前所有同一度量的观察结果之间的度量 。
  • Quadile_over_time()倒置

可能是:

  1. 计数多少观察值小于每个时间戳上的观察值。
  2. 分隔为1。总计观测值。

但是,这似乎仍然超出了我的技能,所以我正在寻找有关我应该采取哪种方式的方向。

Am I missing something or is there no function in promql to calculate either one of the following:
  • the Rank of a metric among previous observations of that same metric.
  • the Percent Rank of a metric among all previous observations of that same metric.
  • Something like the inverse of quantile_over_time()

A roundabout way might be to:

  1. Count how many observations are smaller than the observation at each timestamp.
  2. Divide result from 1. by total number of observations.

However that still seems beyond my skill so I am looking for some direction on which way I should pursue.

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

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

发布评论

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

评论(1

抱着落日 2025-02-13 12:19:09

可能您需要 share_le_over_time victoriametrics的功能(我从事此ProceTheeus likehus light light System)。例如,以下查询将在每个系列的最后一个小时返回原始样本的份额,名称m,该样本不超过42:

share_le_over_time(m[1h], 42)

返回的共享在范围内0 .. 1,其中0表示0%,而1表示100%。

此外,您可以查看 tastagram_share> ,不超过给定的阈值。即,它是contagrage_quantile函数的倒数。

Probably you need share_le_over_time function from VictoriaMetrics (I work on this Prometheus-like system). For example, the following query returns the share of raw samples during the last hour per each series with name m, which don't exceed 42:

share_le_over_time(m[1h], 42)

The returned share is in the range 0 .. 1, where 0 means 0%, while 1 means 100%.

Additionally, you may look at histogram_share function - it returns the share of samples from histogram buckets, which don't exceed the given threshold. I.e. it is an inverse of histogram_quantile function.

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