英文:
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论