Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter metrics in Telegraf before sending them to Datadog?

I have a service that exposes metrics in statsd format and telegraf instance which picks those metrics and sends them to both Prometheus and Datadog (there are two output plugin configurations for both of these). This works correctly. However, I have a special requirement where I would need to filter certain metrics that will be sent to Datadog. My first inclination was to make change in [[outputs.datadog]] section of telegraf.conf. However, I don't see any specific configuration part where I could, for example, list just metrics that I need to be seen on Datadog.

Is there any way to achieve this?

Thanks.

like image 425
Bakir Jusufbegovic Avatar asked Oct 25 '25 15:10

Bakir Jusufbegovic


1 Answers

According to the documentation, this can be achieved using following properties in telegraf.conf:

[[outputs.datadog]]
apikey = "<datadog api key>" # required.
namepass = ["metric_1","metric_2"...etc.]

https://docs.influxdata.com/telegraf/v1.12/administration/configuration/#measurement-filtering

where namepass defines pattern list of points which will be emitted.

like image 186
Bakir Jusufbegovic Avatar answered Oct 28 '25 04:10

Bakir Jusufbegovic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!