Datadog 指标的一个键有多个值?

发布于 2025-01-10 16:32:12 字数 146 浏览 3 评论 0原文

想知道是否支持一个指标的一个标签具有多个值?该用例试图跟踪请求可能失败的多个原因,例如

validation_failures: title_too_long
validation_failures: invalid_email

Wondering if it's supported to have one tag for a metric have multiple values? The use case is trying to track multiple reasons a request may fail, e.g.

validation_failures: title_too_long
validation_failures: invalid_email

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

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

发布评论

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

评论(1

忆梦 2025-01-17 16:32:12

一般来说,单个指标可以有多个标签,这些标签共享相同的“键”但具有不同的“值”。例如,一个指标点可以通过 mykey:foomykey:bar< 来标记/code>.

像这样的“竞争关键标签”指标通常不是一个好的做法,因为冲突的标签值很容易给不熟悉标签应用方式的队友带来更多混乱。增加自定义“错误计数”指标并按其原因进行描述,如果有多种原因,那么在这里添加竞争标签似乎是“正确”的做法

(我说“一般来说”,因为这可能取决于 。关于如何创建指标——如果您从日志事件或其他内容创建指标,这可能会或可能不会像我所说的那样工作。)

Generally speaking, a single metric can have multiple tags that share the same "key" but with different "values. E.g, a metric point can be tagged by mykey:foo and mykey:bar.

Metrics with "competing key tags" like that are usually not a good practice, because conflicting tag values can easily add more confusion than clarity to teammates that aren't familiar with how the tags are applied. But if you're incrementing a custom "error count" metric and describing it by its cause, and if there are multiple causes, then it seems plausible that adding competing tags here might be the "right" thing to do.

(I say "generally speaking", since it probably depends on how you're creating the metrics -- if you're creating the metrics from log events or something, this may or may not work the way i'm saying it will.)

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