influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.15k stars 5.52k forks source link

Outputs.Datadog does not support Distribution typed metrics #15576

Open dirrao opened 1 week ago

dirrao commented 1 week ago

Use Case

Looking for Datadog output plugin to support distribution metric type.

Expected behavior

Looking for Datadog output plugin to support distribution metric type.

Actual behavior

NA

Additional info

No response

dirrao commented 1 week ago

Recreating a new ticket for existing closed ticket #11525

powersj commented 1 week ago

Hi,

The current Datadog output seems to take an API URL as a parameter to send metrics only. By default it is set to https://app.datadoghq.com/api/v1/series, which is for submitting metrics only of type "", "count", "gauge", and "rate".

To send distributions, we need to use https://api.datadoghq.com/api/v1/distribution_points with type "distribution".

The plugin would need to be extended to:

  1. Add a new config option to set the distribution URL
  2. If that URL is set, then collect the metrics of type telegraf.Histogram
  3. After sending the metrics, then create a distribution request and send that using the options

This would be a change in behavior as the current as it does not look like we explicitly omit histograms today unless they error out during metric building?

Would be happy to see a PR to take this on, but need to ensure it is a) opt-in and b) tested and covered by unit tests.