DataDog 中用于计算错误请求百分比和请求数量的指标

发布于 2025-01-14 18:34:09 字数 454 浏览 1 评论 0原文

我们有一个 datadog 指标,可以测量成功的网络请求的百分比,并在超过阈值时向我们发出警报。该指标的一个问题是,当我们没有太多请求时,它会在周末晚上变得嘈杂,甚至一个错误都会使指标超过阈值。

现在的查询是这样的:

"query": "sum(last_30m):sum:q.inquiry{success:true}.as_count() / sum:q.inquiry.as_count() * 100 < 80"

它计算成功的请求数与请求总数的关系,并报告是否超过 80%。

有没有办法执行布尔运算来执行类似的操作,

above_query && sum(last_30m):sum:q.inquiry{success:false}.as_count() > 3

仅当错误请求数大于 3 时才会发出警报

We have a datadog metric that measures a % of successful web requests and alerts us if it's more than threshold. A problem with this metric is that it becomes noisy on weekend nights when we don't have too many requests and even a single error can push the metric over the threshold.

Right now the query is like this:

"query": "sum(last_30m):sum:q.inquiry{success:true}.as_count() / sum:q.inquiry.as_count() * 100 < 80"

which counts the number of requests that succeed vs total number of requests and reports if it's more than 80%.

Is there a way to do a boolean operation to do something like

above_query && sum(last_30m):sum:q.inquiry{success:false}.as_count() > 3

which will only alert if the number of bad requests is greater than 3

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

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

发布评论

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

评论(1

ら栖息 2025-01-21 18:34:09

创建一个在两个查询上触发的复合监视器,其中一个包含计数阈值和百分比阈值。

Create a composite monitor that triggers on your two queries, one with the count threshold and one with the percentage threshold.

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