卷起到整个时间间隔?

huangapple go评论55阅读模式
英文:

Roll up to whole time interval?

问题

在Datadog REST API中,是否有一种方法可以表示我想将整个时间间隔汇总为一个单独的点?假设我有一个指标,在其中我报告0表示失败,1表示成功,我想知道整个月的成功率是多少。

我应该如何构建一个查询/请求,以便我可以获得一个单一点,其中只有一个值,表示上个月的平均值?

英文:

In the Datadog REST API, is there a way to say that I want to roll up my whole time interval into a single point? Let's say I have a metric where I report 0 for failures and 1 for success, and I want to know what the success rate is over a whole month.

How would I construct a query/request such that I get back a single point which just has one value for the average value over the last month?

答案1

得分: 1

听起来你在寻找查询标量 API,可以在此处的 API 文档中找到。对于你的情况,使用 0 和 1 并希望获得速率,你只需查询该度量,将aggregator设置为avg

英文:

It sounds like you're looking for the query scalar API, as found here in the API documentation. For your case with 0s and 1s and wanting to get the rate, you would simply query that metric with the aggregator set to avg.

huangapple
  • 本文由 发表于 2023年4月17日 22:08:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76036062.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定