Limiting Telegraf Aggregator Plugin to Certain Metrics?

181 views Asked by At

i have network interface counter data (bytes in/bytes out) being collected by telegraf thru GNMI subscriptions to network devices. i am storing this raw data (un InfluxDB) already, but i want to add a rate calculation as well. i am considering using the aggregators.derivative plugin in telegraf.

i think i understand the aggregators sit between input plugins and output plugins, but how do i chain them together? for instance, i am gathering several metrics in this instance of telegraf via several input plugins, but i only need a rate calculation for the gnmi plugin data, and only a couple of fields on that metric. how do i limit the scope of the aggregator to just the metrics gathered by the gnmi input plugin?

Or do i just plop the aggregator plugin config into telegraf and it just automatically affects all input plugin data?

i have not tried anything yet because i don't know what to do. The instructions are unclear and i can't seem to find any example configuration in the context of a whole telegraf config.

1

There are 1 answers

0
pj.dewitte On BEST ANSWER

You can use filtering to obtain the desired behavior.

  • Add the aggregation plugin configuration to the configuration file
  • Add "namepass" to the aggregation plugin (see the examples in the link, they are very informative). This filter makes sure only the measurements with the right name are handled by that plugin. The rest goes straight to the output plugin.
  • Optionally, if the aggregator creates more fields than you want, you can use "fielddrop" in the aggregator configuration to drop some of the new fields.

I recommend experimenting with a small configuration file, that helps to understand Telegraf.