node-datadog-metrics icon indicating copy to clipboard operation
node-datadog-metrics copied to clipboard

supplying units/metric metadata

Open d1manson opened this issue 7 years ago • 3 comments

I know you can change set metric metadata in the main datadog interface - as explained here, and there is a way of doing it with an api, but is there any way/plans to expose it in this module?

An optional argument to histogram (and friends) would be ideal..you could cache the last metadata values and only send them if there is a change?

d1manson avatar Nov 09 '17 13:11 d1manson

Sounds like a great addition to the module. Would you be interested in contributing this in a PR? 😄

csabapalfi avatar Nov 09 '17 15:11 csabapalfi

perhaps..we shall see!

d1manson avatar Nov 09 '17 16:11 d1manson

Noting for future reference: this comes with similar caveats as #81. The docs indicate that setting units as part of metric submission is only in the v2 API, which formats things differently, has shorter limits on metric names, and a smaller maximum payload size. There’s likely to be a fair amount that would have to change under the hood to make this work (which doesn’t mean it shouldn’t be done or isn’t worthwhile!).

Another oddity is that the v2 lets you set the unit, but not the per_unit, so it only goes halfway to matching what you can configure in Datadog’s UI.

(One alternative here might be some mechanism that uses the edit metric metadata endpoint, but that would only work if someone includes an appKey in addition to their apiKey, and increases potential security risks for users to consider. It’s probably not a good approach.)

Mr0grog avatar Sep 27 '22 20:09 Mr0grog