在 DataDog 中获得真正的第 95 个百分位数

Getting a true 95th percentile in DataDog

我有一个应用程序向带有多个标签的 DataDog 发布指标,我的 DataDog 代理有一行看起来像

histogram_percentiles: 90, 95, 99

所以我的指标(我们称之为 ResponseTime)在 DataDog 查看器中针对每个指标(即 ResponseTime.90perentile)都有一个指标。

但是,如果您仔细查看此指标,它似乎是在短范围内(不确定是什么)以及针对存在的标签的每个元组计算这些百分位数。

理想情况下,我想要得到的是 ResponseTime 指标在所有标签上的第 95 个百分位数(也许我将其过滤 1 或 2 并有几个不同的图表)但在上周左右。有没有简单的方法可以做到这一点?

However if you look at this metric carefully it appears to be calculating these percentiles on a short range (not sure what) and for each tuple of the tags that exist.

您注意到的短范围实际上是刷新间隔,默认为 10 秒。根据 this datadog 关于直方图指标的文章,

It aggregates the values that are sent during the flush interval (usually defaults to 10 seconds). So if you send 20 values for a metric during the flush interval, it'll give you the aggregation of those values for the flush interval

对于您的查询 -

Ideally what I'd like to get is a 95th percentile of the ResponseTime metric over all the tags (maybe I filter it down by 1 or 2 and have a couple of different graphs) but over the last week or so. Is there an easy way to do this?

根据我对 datadog 文档的阅读,目前没有办法完成这项工作。与 datadog 支持核实一下这可能是个好主意。

更多详情here

Datadog 现在支持 distribution metric type,它在 Datadog 服务器端聚合数据,而不是在代理端以闪烁间隔聚合数据(如直方图)。这允许在任何时间段内计算真实的 p95s 等。

开始发出分布指标后,您需要在 Metric Summary 页面上为指标启用百分位数:

然后您应该能够在图形编辑器上看到百分位数:

如果您将指标从直方图更改为分布指标,您还需要为该指标使用新名称。