How to get telegraf internal metrics

Dear All,
I want to monitor telegraf status. Is there any way to get telegraf internal metrics , like memory usage, how many metrics telegraf processing per min , queue size , and output the metrics to influx or graphite.

1 Like

You can enable this plugin: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/internal

1 Like

Dear Daniel,
Thank you for the information and it works. I can get the internal metrics now.

Dear @Daniel_Li,
After I enable the internal plugin, I find the telegraf mem usage is very smaller than ps command show, is it right?

telegraf config

[[inputs.internal]]
collect_memstats = true
name_prefix = "tngxxxx.telegraf-health."

[[outputs.graphite]]
  ## TCP endpoint for your graphite instance.
  ## If multiple endpoints are configured, output will be load balanced.
  ## Only one of the endpoints will be written to with each iteration.
  servers = ["xxxx:2013","xxxx:2013"]
  ## Prefix metrics name
  prefix = ""
  ## Graphite output template
  ## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  template = "host.tags.measurement.field"
  ## timeout in seconds for the write connection to graphite
  timeout = 2

#ps aux |grep telegraf
telegraf 12522  0.4  0.2 306916 18300 ?        Ssl  15:16   0:29 /usr/bin/telegraf -config 
/etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

@fann_keyboard If you are using telegraf you can easily get a much better user experience with InfluxDB and Chronograf. Might be worth checking out!

Dear @jackzampolin,
Thank you for the suggestion, but our production is still using graphite, so we don’t change it in this moment. I think the telegraf internal metrics value, no matter into influx or into graphite, should be the same.