influxdata / telegraf

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

Telegraf win_perf_counters not sending input counters with % #1430

Closed ghost closed 8 years ago

ghost commented 8 years ago

It appears that Telegraf is not allowing metrics with % to send over to a listening Prometheus server. Any metric without a % works without issue.

telegraf.conf:

##############################################################################
#                                  OUTPUTS                                    #
###############################################################################

# Configuration for prometheus server
[[outputs.prometheus_client]]

  # Address to listen on
    listen = ":9126"

###############################################################################
#                                  INPUTS                                     #
###############################################################################

  [[inputs.win_perf_counters]]
    PrintValid = true

  [[inputs.win_perf_counters.object]]
    ObjectName = "Processor"
    Instances = ["*"]
    Counters = ["% C1 time", "% C2 time", "% C3 time", "% DPC time", "% Idle Time", "% Interrupt Time", "% Privileged Time", "% User Time", "% Processor Time"]
    Measurement = "win_cpu"
    #IncludeTotal=false
    #WarnOnMissing = true

  [[inputs.win_perf_counters.object]]
    ObjectName = "LogicalDisk"
    Instances = ["*"]
    Counters = ["% Idle Time", "% Disk Time","% Disk Read Time", "% Disk Write Time", "Current Disk Queue Length"]
    Measurement = "win_disk"
    #IncludeTotal=false
    #WarnOnMissing = true

  [[inputs.win_perf_counters.object]]
    ObjectName = "PhysicalDisk"
    Instances = ["*"]
    Counters = ["Disk Read Bytes/sec", "Disk Write Bytes/sec"]
    Measurement = "win_disk"
    #IncludeTotal=false
    #WarnOnMissing = true

  [[inputs.win_perf_counters.object]]
    ObjectName = "System"
    Counters = ["Context Switches/sec","System Calls/sec"]
    Instances = ["------"]
    Measurement = "win_system"
    #IncludeTotal=false
    #WarnOnMissing = true

  [[inputs.win_perf_counters.object]]
    ObjectName = "Memory"
    Counters = ["Available Bytes","Cache Faults/sec","Demand Zero Faults/sec","Page    Faults/sec","Pages/sec","Transition Faults/sec","Pool Nonpaged Bytes","Pool Paged Bytes"]
    Instances = ["------"] # Use 6 x - to remove the Instance bit from the query.
    Measurement = "win_mem"
    #IncludeTotal=false
    #WarnOnMissing = true

  [[inputs.win_perf_counters.object]]
    ObjectName = "Network Interface"
    Counters = ["Bytes Received/sec","Bytes Sent/sec","Packets Received/sec","Packets Sent/sec"]
    Instances = ["*"] # Use 6 x - to remove the Instance bit from the query.
    Measurement = "win_net"
    #IncludeTotal=false
    #WarnOnMissing = true

Log Info

PS C:\Windows\system32> c:\telegraf\telegraf.exe -config c:\telegraf\telegraf.conf
c:\telegraf\telegraf.exe : 2016/06/30 11:18:13 Attempting connection to output: prometheus_client
At line:1 char:1
+ c:\telegraf\telegraf.exe -config c:\telegraf\telegraf.conf
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (2016/06/30 11:1...ometheus_client:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

2016/06/30 11:18:13 Successfully connected to output: prometheus_client
2016/06/30 11:18:13 Starting Telegraf (version 1.0.0-beta2)
2016/06/30 11:18:13 Loaded outputs: prometheus_client
2016/06/30 11:18:13 Loaded inputs: win_perf_counters
2016/06/30 11:18:13 Tags enabled: host=NMX-WIN7-Test
2016/06/30 11:18:13 Agent Config: Interval:10s, Debug:true, Quiet:false, Hostname:"NMX-WIN7-Test", Flush 
Interval:10s 
Valid: \Processor(*)\% C1 time
Valid: \Processor(*)\% C2 time
Valid: \Processor(*)\% C3 time
Valid: \Processor(*)\% DPC time
Valid: \Processor(*)\% Idle Time
Valid: \Processor(*)\% Interrupt Time
Valid: \Processor(*)\% Privileged Time
Valid: \Processor(*)\% User Time
Valid: \Processor(*)\% Processor Time
Valid: \LogicalDisk(*)\% Idle Time
Valid: \LogicalDisk(*)\% Disk Time
Valid: \LogicalDisk(*)\% Disk Read Time
Valid: \LogicalDisk(*)\% Disk Write Time
Valid: \LogicalDisk(*)\Current Disk Queue Length
Valid: \PhysicalDisk(*)\Disk Read Bytes/sec
Valid: \PhysicalDisk(*)\Disk Write Bytes/sec
Valid: \System\Context Switches/sec
Valid: \System\System Calls/sec
Valid: \Memory\Available Bytes
Valid: \Memory\Cache Faults/sec
Valid: \Memory\Demand Zero Faults/sec
Valid: \Memory\Page Faults/sec
Valid: \Memory\Pages/sec
Valid: \Memory\Transition Faults/sec
Valid: \Memory\Pool Nonpaged Bytes
Valid: \Memory\Pool Paged Bytes
2016/06/30 11:18:21 Input [win_perf_counters] gathered metrics, (10s interval) in 1.5288027s
Valid: \Network Interface(*)\Bytes Received/sec
Valid: \Network Interface(*)\Bytes Sent/sec
Valid: \Network Interface(*)\Packets Received/sec
Valid: \Network Interface(*)\Packets Sent/sec
2016/06/30 11:18:30 Input [win_perf_counters] gathered metrics, (10s interval) in 0
2016/06/30 11:18:30 Output [prometheus_client] buffer fullness: 53 / 1000 metrics. Total gathered metrics: 
53. Total dropped metrics: 0.
2016/06/30 11:18:30 Output [prometheus_client] wrote batch of 53 metrics in 0
2016/06/30 11:18:40 Input [win_perf_counters] gathered metrics, (10s interval) in 15.6ms
2016/06/30 11:18:40 Output [prometheus_client] buffer fullness: 48 / 1000 metrics. Total gathered metrics: 
101. Total dropped metrics: 0.
2016/06/30 11:18:40 Output [prometheus_client] wrote batch of 48 metrics in 0
2016/06/30 11:18:50 Input [win_perf_counters] gathered metrics, (10s interval) in 0
2016/06/30 11:18:50 Output [prometheus_client] buffer fullness: 48 / 1000 metrics. Total gathered metrics: 
149. Total dropped metrics: 0.
2016/06/30 11:18:50 Output [prometheus_client] wrote batch of 48 metrics in 0

PS C:\Windows\system32>

System info:

Telegraf (version 1.0.0-beta2) Windows 7 Professional Virtual Machine

Steps to reproduce:

  1. Execute Telegraf
  2. Wait for metrics to send

    Expected behavior:

Metrics with % should be showing up in Prometheus server

Actual behavior:

Metrics with % do not show up in Prometheus server

sparrc commented 8 years ago

thanks for the report, PR is up for fix: #1523