显示DataDog中自定义度量的最后一个值的日期

发布于 2025-02-03 08:21:50 字数 584 浏览 2 评论 0原文

我正在搜索在DD仪表板中显示公制的最后一个值的日期。我可以为此使用一个简单的QueryValue字段,但是我不知道如何获得该指标的日期而不是其价值。

例子 : mymetric = [21,5,42] 假设这些指标的相关日期是 ['1/1/2022','1/2/2022','27/2/2022']

我想显示27/2/2022。

目前,我只显示此查询的值,


"queries": [
    {
         "query": "max:mycounter{$env}",
         "data_source": "metrics",
         "name": "query1",
         "aggregator": "last"
    }
]

DataDog可以使用吗?

实际上,我找到了一个解决方法,但这似乎有点不优化。我也从我的代码mycounter.date_day mycounter.date_month and mycounter.date_year推出。然后,我可以在3个不同的QueryValue中显示一天的一个月。

问候, 混合。

I'm searching to display in a DD Dashboard the date of the last value of a metric. I can use a simple QueryValue field for that, however I don't know how I can get the date of this metric instead of its value.

Example :
mymetric = [21,5,42]
let's say that the relevant dates for those metrics are
['1/1/2022', '1/2/2022', '27/2/2022']

I'd like to display 27/2/2022.

For now, I'm displaying only the value with this query


"queries": [
    {
         "query": "max:mycounter{$env}",
         "data_source": "metrics",
         "name": "query1",
         "aggregator": "last"
    }
]

Is it possible with Datadog ?

In fact I've found a workaround, but that seems a little bit unoptimized. I push also from my code mycounter.date_day mycounter.date_month and mycounter.date_year. And then I can display day month year in 3 different QueryValue.

Regards,
Blured.

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

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

发布评论

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

评论(1

街角卖回忆 2025-02-10 08:21:50

这不是为DataDog指标设计的用例。您发现的任何解决方案都将是非常骇人听闻的。

这似乎也许不是自定义指标,而是要发送日志或事件,并带有可以显示的日期/时间属性。即使这听起来也不是您想要的东西。

如果您真的想以一种干净的方式使此工作,我想您可以尝试将自己的自定义Datadog小部件作为应用程序开发: https://www.datadadoghq.com/blog/datadog-apps/ 参考文档

但是,无论您的目标是什么,都必须重新设计,以便更有意义地为datadog的构建而有意义。

This is not a use case Datadog metrics are designed for. Any solution you find is going to be pretty hacky.

This seems like maybe instead of a custom metric, you'd want to be sending a log or event, with date/time attributes that you can display. Even that doesn't really sound close to what you're looking for though.

If you really wanted to get this working in a clean way, I suppose you could try developing your own custom Datadog widget as an app: https://www.datadoghq.com/blog/datadog-apps/ (reference docs)

But whatever your goal is might just have to be redesigned to make more sense for what Datadog is built for.

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