beam-telemetry / telemetry_metrics_statsd

Telemetry.Metrics reporter for StatsD-compatible metric servers

Home Page:https://hexdocs.pm/telemetry_metrics_statsd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Datadog distribution metric support

hkrutzer opened this issue · comments

Datadog unfortunately has a new metric type called distribution that we'd like to use.

I think the easiest way (for me) would be to allow a custom formatter instead of the standard and Datadog formatters. I can then add a custom metric, and have the custom formatter send it with the |d type. telemetry_metrics already having a metric called "distribution" doesn't help of course.

Can send a PR for this change or some other solution.

@hkrutzer as I understand it, DataDog's distribution is like a histogram but allows aggregation from multiple agents, correct?

In that case, a custom metric + formatter would be indeed a way to go. I suppose the only required change is to make a behaviour here public, and to allow passing a module name as a formatter.

@arkgil correct! I have some code that I will contribute this week.

@hkrutzer I just realized that we can do this without implementing a custom formatter. Since :reporter_options have been added to Telemetry.Metrics, we can use them to tell the reporter to export distribution as a DataDog distribution.

Seems like with this approach there would be less moving parts. And, after all, we have a DataDog formatter which should support this kind of metric.

What do you think? Sorry for late notice, it just came to my mind this morning 😅

@bryannaegele do you have any thoughts on this?