Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I debug Telegraf?

I'm trying to get telegraf working with influxdb and I've just hit a wall. I added the following block in my telegraf config file:

[[inputs.win_perf_counters.object]]
# Process metrics, in this case for IIS only
ObjectName = "Process"
Instances = ["W3SVC"]
Counters = ["% Processor Time","Handle Count","Private Bytes","Thread Count","Virtual Bytes","Working Set"]
Measurement = "win_proc"

However, when I search my db, I never see that measurement. I know that process is running, so it should be outputting something. The problem is that even though I have logging turned on, there's no logfile. There's also nothing in the event viewer. Short of downloading the source code and running the program in a local debugger, I have no idea how to proceed. Does anyone have any ideas?

like image 991
mrplainswalker Avatar asked Jun 01 '20 17:06

mrplainswalker


1 Answers

[agent]
  ## Default data collection interval for all inputs
  interval = "10s"
  ## Log at debug level.
  debug = true
  ## Log only error level messages.
  quiet = false

  ## Log target controls the destination for logs and can be one of "file",
  ## "stderr" or, on Windows, "eventlog".  When set to "file", the output file
  ## is determined by the "logfile" setting.
  # logtarget = "file"

  ## Name of the file to be logged to when using the "file" logtarget.  If set to
  ## the empty string then logs are written to stderr.
  # logfile = ""

You can specify debug = true in the agent config to print the debug logs. If you don't specify any log file, the logs will be printed on terminal.
like image 85
Tamil Selvan V Avatar answered Oct 23 '22 04:10

Tamil Selvan V