Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental generic perfdata collector #1459

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

jkroepke
Copy link
Member

@jkroepke jkroepke commented Apr 27, 2024

Ref #1350
Fixes #1414

This PR setup a generic performance data collectors based on the users configuration.

Instead existing collectors that is using the perflib, the perfdata collector using the Performance Data Helpers function. See #1350

Implement the Performance Data Helpers as separate collector may have multiple oppunities:

It's easier to compare data between Performance Data Helpers and Performance Data from perflib

Any PerfData custom metrics can be implement now, without having the hard requirement of implement collector of each single subsystem.

Example:

--collectors.enabled="perfdata" --collector.perfdata.objects='[{"failOnMissing":true,"objectName":"Processor Information","instances":["*"],"counters":["*"],"includeTotal":false},{"failOnMissing":true,"objectName":"LogicalDisk","instances":["*"],"counters":["*"],"includeTotal":false},{"failOnMissing":true,"objectName":"PhysicalDisk","instances":["*"],"counters":["*"],"includeTotal":false}]'

Produces this:

Details
# HELP windows_perfdata_logicaldisk_avg_disk_bytes_read Avg. Disk Bytes/Read is the average number of bytes transferred from the disk during read operations.
# TYPE windows_perfdata_logicaldisk_avg_disk_bytes_read gauge
windows_perfdata_logicaldisk_avg_disk_bytes_read{instance="C:"} 5.550596608e+09
windows_perfdata_logicaldisk_avg_disk_bytes_read{instance="D:"} 24576
windows_perfdata_logicaldisk_avg_disk_bytes_read{instance="HarddiskVolume2"} 2560
windows_perfdata_logicaldisk_avg_disk_bytes_read{instance="HarddiskVolume3"} 6.086656e+06
# HELP windows_perfdata_logicaldisk_avg_disk_bytes_transfer Avg. Disk Bytes/Transfer is the average number of bytes transferred to or from the disk during write or read operations.
# TYPE windows_perfdata_logicaldisk_avg_disk_bytes_transfer gauge
windows_perfdata_logicaldisk_avg_disk_bytes_transfer{instance="C:"} 1.4838193152e+10
windows_perfdata_logicaldisk_avg_disk_bytes_transfer{instance="D:"} 6.977536e+07
windows_perfdata_logicaldisk_avg_disk_bytes_transfer{instance="HarddiskVolume2"} 96768
windows_perfdata_logicaldisk_avg_disk_bytes_transfer{instance="HarddiskVolume3"} 6.609408e+06
# HELP windows_perfdata_logicaldisk_avg_disk_bytes_write Avg. Disk Bytes/Write is the average number of bytes transferred to the disk during write operations.
# TYPE windows_perfdata_logicaldisk_avg_disk_bytes_write gauge
windows_perfdata_logicaldisk_avg_disk_bytes_write{instance="C:"} 9.287596544e+09
windows_perfdata_logicaldisk_avg_disk_bytes_write{instance="D:"} 6.9750784e+07
windows_perfdata_logicaldisk_avg_disk_bytes_write{instance="HarddiskVolume2"} 94208
windows_perfdata_logicaldisk_avg_disk_bytes_write{instance="HarddiskVolume3"} 522752
# HELP windows_perfdata_logicaldisk_avg_disk_queue_length Avg. Disk Queue Length is the average number of both read and write requests that were queued for the selected disk during the sample interval.
# TYPE windows_perfdata_logicaldisk_avg_disk_queue_length counter
windows_perfdata_logicaldisk_avg_disk_queue_length{instance="C:"} 1.0852413781e+10
windows_perfdata_logicaldisk_avg_disk_queue_length{instance="D:"} 1.255649e+06
windows_perfdata_logicaldisk_avg_disk_queue_length{instance="HarddiskVolume2"} 12475
windows_perfdata_logicaldisk_avg_disk_queue_length{instance="HarddiskVolume3"} 4.083917e+06
# HELP windows_perfdata_logicaldisk_avg_disk_read_queue_length Avg. Disk Read Queue Length is the average number of read requests that were queued for the selected disk during the sample interval.
# TYPE windows_perfdata_logicaldisk_avg_disk_read_queue_length counter
windows_perfdata_logicaldisk_avg_disk_read_queue_length{instance="C:"} 8.080905889e+09
windows_perfdata_logicaldisk_avg_disk_read_queue_length{instance="D:"} 11153
windows_perfdata_logicaldisk_avg_disk_read_queue_length{instance="HarddiskVolume2"} 572
windows_perfdata_logicaldisk_avg_disk_read_queue_length{instance="HarddiskVolume3"} 894134
# HELP windows_perfdata_logicaldisk_avg_disk_sec_read Avg. Disk sec/Read is the average time, in seconds, of a read of data from the disk.
# TYPE windows_perfdata_logicaldisk_avg_disk_sec_read gauge
windows_perfdata_logicaldisk_avg_disk_sec_read{instance="C:"} 8.080905889e+09
windows_perfdata_logicaldisk_avg_disk_sec_read{instance="D:"} 11153
windows_perfdata_logicaldisk_avg_disk_sec_read{instance="HarddiskVolume2"} 572
windows_perfdata_logicaldisk_avg_disk_sec_read{instance="HarddiskVolume3"} 894134
# HELP windows_perfdata_logicaldisk_avg_disk_sec_transfer Avg. Disk sec/Transfer is the time, in seconds, of the average disk transfer.
# TYPE windows_perfdata_logicaldisk_avg_disk_sec_transfer gauge
windows_perfdata_logicaldisk_avg_disk_sec_transfer{instance="C:"} 1.0852413781e+10
windows_perfdata_logicaldisk_avg_disk_sec_transfer{instance="D:"} 1.255649e+06
windows_perfdata_logicaldisk_avg_disk_sec_transfer{instance="HarddiskVolume2"} 12475
windows_perfdata_logicaldisk_avg_disk_sec_transfer{instance="HarddiskVolume3"} 4.083917e+06
# HELP windows_perfdata_logicaldisk_avg_disk_sec_write Avg. Disk sec/Write is the average time, in seconds, of a write of data to the disk.
# TYPE windows_perfdata_logicaldisk_avg_disk_sec_write gauge
windows_perfdata_logicaldisk_avg_disk_sec_write{instance="C:"} 2.771507892e+09
windows_perfdata_logicaldisk_avg_disk_sec_write{instance="D:"} 1.244496e+06
windows_perfdata_logicaldisk_avg_disk_sec_write{instance="HarddiskVolume2"} 11903
windows_perfdata_logicaldisk_avg_disk_sec_write{instance="HarddiskVolume3"} 3.189783e+06
# HELP windows_perfdata_logicaldisk_avg_disk_write_queue_length Avg. Disk Write Queue Length is the average number of write requests that were queued for the selected disk during the sample interval.
# TYPE windows_perfdata_logicaldisk_avg_disk_write_queue_length counter
windows_perfdata_logicaldisk_avg_disk_write_queue_length{instance="C:"} 2.771507892e+09
windows_perfdata_logicaldisk_avg_disk_write_queue_length{instance="D:"} 1.244496e+06
windows_perfdata_logicaldisk_avg_disk_write_queue_length{instance="HarddiskVolume2"} 11903
windows_perfdata_logicaldisk_avg_disk_write_queue_length{instance="HarddiskVolume3"} 3.189783e+06
# HELP windows_perfdata_logicaldisk_current_disk_queue_length Current Disk Queue Length is the number of requests outstanding on the disk at the time the performance data is collected. It also includes requests in service at the time of the collection. This is a instantaneous snapshot, not an average over the time interval. Multi-spindle disk devices can have multiple requests that are active at one time, but other concurrent requests are awaiting service. This counter might reflect a transitory high or low queue length, but if there is a sustained load on the disk drive, it is likely that this will be consistently high. Requests experience delays proportional to the length of this queue minus the number of spindles on the disks. For good performance, this difference should average less than two.
# TYPE windows_perfdata_logicaldisk_current_disk_queue_length gauge
windows_perfdata_logicaldisk_current_disk_queue_length{instance="C:"} 0
windows_perfdata_logicaldisk_current_disk_queue_length{instance="D:"} 0
windows_perfdata_logicaldisk_current_disk_queue_length{instance="HarddiskVolume2"} 0
windows_perfdata_logicaldisk_current_disk_queue_length{instance="HarddiskVolume3"} 0
# HELP windows_perfdata_logicaldisk_disk_bytes_sec Disk Bytes/sec is the rate bytes are transferred to or from the disk during write or read operations.
# TYPE windows_perfdata_logicaldisk_disk_bytes_sec counter
windows_perfdata_logicaldisk_disk_bytes_sec{instance="C:"} 1.4838193152e+10
windows_perfdata_logicaldisk_disk_bytes_sec{instance="D:"} 6.977536e+07
windows_perfdata_logicaldisk_disk_bytes_sec{instance="HarddiskVolume2"} 96768
windows_perfdata_logicaldisk_disk_bytes_sec{instance="HarddiskVolume3"} 6.609408e+06
# HELP windows_perfdata_logicaldisk_disk_read_bytes_sec Disk Read Bytes/sec is the rate at which bytes are transferred from the disk during read operations.
# TYPE windows_perfdata_logicaldisk_disk_read_bytes_sec counter
windows_perfdata_logicaldisk_disk_read_bytes_sec{instance="C:"} 5.550596608e+09
windows_perfdata_logicaldisk_disk_read_bytes_sec{instance="D:"} 24576
windows_perfdata_logicaldisk_disk_read_bytes_sec{instance="HarddiskVolume2"} 2560
windows_perfdata_logicaldisk_disk_read_bytes_sec{instance="HarddiskVolume3"} 6.086656e+06
# HELP windows_perfdata_logicaldisk_disk_read_time % Disk Read Time is the percentage of elapsed time that the selected disk drive was busy servicing read requests.
# TYPE windows_perfdata_logicaldisk_disk_read_time counter
windows_perfdata_logicaldisk_disk_read_time{instance="C:"} 8.080905889e+09
windows_perfdata_logicaldisk_disk_read_time{instance="D:"} 11153
windows_perfdata_logicaldisk_disk_read_time{instance="HarddiskVolume2"} 572
windows_perfdata_logicaldisk_disk_read_time{instance="HarddiskVolume3"} 894134
# HELP windows_perfdata_logicaldisk_disk_reads_sec Disk Reads/sec is the rate of read operations on the disk.
# TYPE windows_perfdata_logicaldisk_disk_reads_sec counter
windows_perfdata_logicaldisk_disk_reads_sec{instance="C:"} 169878
windows_perfdata_logicaldisk_disk_reads_sec{instance="D:"} 5
windows_perfdata_logicaldisk_disk_reads_sec{instance="HarddiskVolume2"} 1
windows_perfdata_logicaldisk_disk_reads_sec{instance="HarddiskVolume3"} 55
# HELP windows_perfdata_logicaldisk_disk_time % Disk Time is the percentage of elapsed time that the selected disk drive was busy servicing read or write requests.
# TYPE windows_perfdata_logicaldisk_disk_time counter
windows_perfdata_logicaldisk_disk_time{instance="C:"} 1.0852413781e+10
windows_perfdata_logicaldisk_disk_time{instance="D:"} 1.255649e+06
windows_perfdata_logicaldisk_disk_time{instance="HarddiskVolume2"} 12475
windows_perfdata_logicaldisk_disk_time{instance="HarddiskVolume3"} 4.083917e+06
# HELP windows_perfdata_logicaldisk_disk_transfers_sec Disk Transfers/sec is the rate of read and write operations on the disk.
# TYPE windows_perfdata_logicaldisk_disk_transfers_sec counter
windows_perfdata_logicaldisk_disk_transfers_sec{instance="C:"} 335822
windows_perfdata_logicaldisk_disk_transfers_sec{instance="D:"} 467
windows_perfdata_logicaldisk_disk_transfers_sec{instance="HarddiskVolume2"} 17
windows_perfdata_logicaldisk_disk_transfers_sec{instance="HarddiskVolume3"} 331
# HELP windows_perfdata_logicaldisk_disk_write_bytes_sec Disk Write Bytes/sec is rate at which bytes are transferred to the disk during write operations.
# TYPE windows_perfdata_logicaldisk_disk_write_bytes_sec counter
windows_perfdata_logicaldisk_disk_write_bytes_sec{instance="C:"} 9.287596544e+09
windows_perfdata_logicaldisk_disk_write_bytes_sec{instance="D:"} 6.9750784e+07
windows_perfdata_logicaldisk_disk_write_bytes_sec{instance="HarddiskVolume2"} 94208
windows_perfdata_logicaldisk_disk_write_bytes_sec{instance="HarddiskVolume3"} 522752
# HELP windows_perfdata_logicaldisk_disk_write_time % Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.
# TYPE windows_perfdata_logicaldisk_disk_write_time counter
windows_perfdata_logicaldisk_disk_write_time{instance="C:"} 2.771507892e+09
windows_perfdata_logicaldisk_disk_write_time{instance="D:"} 1.244496e+06
windows_perfdata_logicaldisk_disk_write_time{instance="HarddiskVolume2"} 11903
windows_perfdata_logicaldisk_disk_write_time{instance="HarddiskVolume3"} 3.189783e+06
# HELP windows_perfdata_logicaldisk_disk_writes_sec Disk Writes/sec is the rate of write operations on the disk.
# TYPE windows_perfdata_logicaldisk_disk_writes_sec counter
windows_perfdata_logicaldisk_disk_writes_sec{instance="C:"} 165944
windows_perfdata_logicaldisk_disk_writes_sec{instance="D:"} 462
windows_perfdata_logicaldisk_disk_writes_sec{instance="HarddiskVolume2"} 16
windows_perfdata_logicaldisk_disk_writes_sec{instance="HarddiskVolume3"} 276
# HELP windows_perfdata_logicaldisk_free_megabytes Free Megabytes displays the unallocated space, in megabytes, on the disk drive in megabytes. One megabyte is equal to 1,048,576 bytes.
# TYPE windows_perfdata_logicaldisk_free_megabytes gauge
windows_perfdata_logicaldisk_free_megabytes{instance="C:"} 82610
windows_perfdata_logicaldisk_free_megabytes{instance="D:"} 150547
windows_perfdata_logicaldisk_free_megabytes{instance="HarddiskVolume2"} 432
windows_perfdata_logicaldisk_free_megabytes{instance="HarddiskVolume3"} 66
# HELP windows_perfdata_logicaldisk_free_space % Free Space is the percentage of total usable space on the selected logical disk drive that was free.
# TYPE windows_perfdata_logicaldisk_free_space gauge
windows_perfdata_logicaldisk_free_space{instance="C:"} 82610
windows_perfdata_logicaldisk_free_space{instance="D:"} 150547
windows_perfdata_logicaldisk_free_space{instance="HarddiskVolume2"} 432
windows_perfdata_logicaldisk_free_space{instance="HarddiskVolume3"} 66
# HELP windows_perfdata_logicaldisk_idle_time % Idle Time reports the percentage of time during the sample interval that the disk was idle.
# TYPE windows_perfdata_logicaldisk_idle_time counter
windows_perfdata_logicaldisk_idle_time{instance="C:"} 2.0685469287e+11
windows_perfdata_logicaldisk_idle_time{instance="D:"} 1.10276281417e+11
windows_perfdata_logicaldisk_idle_time{instance="HarddiskVolume2"} 1.04076472627e+11
windows_perfdata_logicaldisk_idle_time{instance="HarddiskVolume3"} 1.08146254611e+11
# HELP windows_perfdata_logicaldisk_split_io_sec Split IO/Sec reports the rate at which I/Os to the disk were split into multiple I/Os. A split I/O may result from requesting data of a size that is too large to fit into a single I/O or that the disk is fragmented.
# TYPE windows_perfdata_logicaldisk_split_io_sec counter
windows_perfdata_logicaldisk_split_io_sec{instance="C:"} 36313
windows_perfdata_logicaldisk_split_io_sec{instance="D:"} 81
windows_perfdata_logicaldisk_split_io_sec{instance="HarddiskVolume2"} 0
windows_perfdata_logicaldisk_split_io_sec{instance="HarddiskVolume3"} 233
# HELP windows_perfdata_physicaldisk_avg_disk_bytes_read Avg. Disk Bytes/Read is the average number of bytes transferred from the disk during read operations.
# TYPE windows_perfdata_physicaldisk_avg_disk_bytes_read gauge
windows_perfdata_physicaldisk_avg_disk_bytes_read{instance="0 C:"} 5.91219968e+09
windows_perfdata_physicaldisk_avg_disk_bytes_read{instance="1 D:"} 24576
# HELP windows_perfdata_physicaldisk_avg_disk_bytes_transfer Avg. Disk Bytes/Transfer is the average number of bytes transferred to or from the disk during write or read operations.
# TYPE windows_perfdata_physicaldisk_avg_disk_bytes_transfer gauge
windows_perfdata_physicaldisk_avg_disk_bytes_transfer{instance="0 C:"} 1.5216717824e+10
windows_perfdata_physicaldisk_avg_disk_bytes_transfer{instance="1 D:"} 6.977536e+07
# HELP windows_perfdata_physicaldisk_avg_disk_bytes_write Avg. Disk Bytes/Write is the average number of bytes transferred to the disk during write operations.
# TYPE windows_perfdata_physicaldisk_avg_disk_bytes_write gauge
windows_perfdata_physicaldisk_avg_disk_bytes_write{instance="0 C:"} 9.304518144e+09
windows_perfdata_physicaldisk_avg_disk_bytes_write{instance="1 D:"} 6.9750784e+07
# HELP windows_perfdata_physicaldisk_avg_disk_queue_length Avg. Disk Queue Length is the average number of both read and write requests that were queued for the selected disk during the sample interval.
# TYPE windows_perfdata_physicaldisk_avg_disk_queue_length counter
windows_perfdata_physicaldisk_avg_disk_queue_length{instance="0 C:"} 1.1338360211e+10
windows_perfdata_physicaldisk_avg_disk_queue_length{instance="1 D:"} 1.250709e+06
# HELP windows_perfdata_physicaldisk_avg_disk_read_queue_length Avg. Disk Read Queue Length is the average number of read requests that were queued for the selected disk during the sample interval.
# TYPE windows_perfdata_physicaldisk_avg_disk_read_queue_length counter
windows_perfdata_physicaldisk_avg_disk_read_queue_length{instance="0 C:"} 8.540636728e+09
windows_perfdata_physicaldisk_avg_disk_read_queue_length{instance="1 D:"} 11052
# HELP windows_perfdata_physicaldisk_avg_disk_sec_read Avg. Disk sec/Read is the average time, in seconds, of a read of data from the disk.
# TYPE windows_perfdata_physicaldisk_avg_disk_sec_read gauge
windows_perfdata_physicaldisk_avg_disk_sec_read{instance="0 C:"} 8.540636728e+09
windows_perfdata_physicaldisk_avg_disk_sec_read{instance="1 D:"} 11052
# HELP windows_perfdata_physicaldisk_avg_disk_sec_transfer Avg. Disk sec/Transfer is the time, in seconds, of the average disk transfer.
# TYPE windows_perfdata_physicaldisk_avg_disk_sec_transfer gauge
windows_perfdata_physicaldisk_avg_disk_sec_transfer{instance="0 C:"} 1.1338360211e+10
windows_perfdata_physicaldisk_avg_disk_sec_transfer{instance="1 D:"} 1.250709e+06
# HELP windows_perfdata_physicaldisk_avg_disk_sec_write Avg. Disk sec/Write is the average time, in seconds, of a write of data to the disk.
# TYPE windows_perfdata_physicaldisk_avg_disk_sec_write gauge
windows_perfdata_physicaldisk_avg_disk_sec_write{instance="0 C:"} 2.797723483e+09
windows_perfdata_physicaldisk_avg_disk_sec_write{instance="1 D:"} 1.239657e+06
# HELP windows_perfdata_physicaldisk_avg_disk_write_queue_length Avg. Disk Write Queue Length is the average number of write requests that were queued for the selected disk during the sample interval.
# TYPE windows_perfdata_physicaldisk_avg_disk_write_queue_length counter
windows_perfdata_physicaldisk_avg_disk_write_queue_length{instance="0 C:"} 2.797723483e+09
windows_perfdata_physicaldisk_avg_disk_write_queue_length{instance="1 D:"} 1.239657e+06
# HELP windows_perfdata_physicaldisk_current_disk_queue_length Current Disk Queue Length is the number of requests outstanding on the disk at the time the performance data is collected. It also includes requests in service at the time of the collection. This is a instantaneous snapshot, not an average over the time interval. Multi-spindle disk devices can have multiple requests that are active at one time, but other concurrent requests are awaiting service. This counter might reflect a transitory high or low queue length, but if there is a sustained load on the disk drive, it is likely that this will be consistently high. Requests experience delays proportional to the length of this queue minus the number of spindles on the disks. For good performance, this difference should average less than two.
# TYPE windows_perfdata_physicaldisk_current_disk_queue_length gauge
windows_perfdata_physicaldisk_current_disk_queue_length{instance="0 C:"} 0
windows_perfdata_physicaldisk_current_disk_queue_length{instance="1 D:"} 0
# HELP windows_perfdata_physicaldisk_disk_bytes_sec Disk Bytes/sec is the rate bytes are transferred to or from the disk during write or read operations.
# TYPE windows_perfdata_physicaldisk_disk_bytes_sec counter
windows_perfdata_physicaldisk_disk_bytes_sec{instance="0 C:"} 1.5216717824e+10
windows_perfdata_physicaldisk_disk_bytes_sec{instance="1 D:"} 6.977536e+07
# HELP windows_perfdata_physicaldisk_disk_read_bytes_sec Disk Read Bytes/sec is the rate at which bytes are transferred from the disk during read operations.
# TYPE windows_perfdata_physicaldisk_disk_read_bytes_sec counter
windows_perfdata_physicaldisk_disk_read_bytes_sec{instance="0 C:"} 5.91219968e+09
windows_perfdata_physicaldisk_disk_read_bytes_sec{instance="1 D:"} 24576
# HELP windows_perfdata_physicaldisk_disk_read_time % Disk Read Time is the percentage of elapsed time that the selected disk drive was busy servicing read requests.
# TYPE windows_perfdata_physicaldisk_disk_read_time counter
windows_perfdata_physicaldisk_disk_read_time{instance="0 C:"} 8.540636728e+09
windows_perfdata_physicaldisk_disk_read_time{instance="1 D:"} 11052
# HELP windows_perfdata_physicaldisk_disk_reads_sec Disk Reads/sec is the rate of read operations on the disk.
# TYPE windows_perfdata_physicaldisk_disk_reads_sec counter
windows_perfdata_physicaldisk_disk_reads_sec{instance="0 C:"} 186153
windows_perfdata_physicaldisk_disk_reads_sec{instance="1 D:"} 5
# HELP windows_perfdata_physicaldisk_disk_time % Disk Time is the percentage of elapsed time that the selected disk drive was busy servicing read or write requests.
# TYPE windows_perfdata_physicaldisk_disk_time counter
windows_perfdata_physicaldisk_disk_time{instance="0 C:"} 1.1338360211e+10
windows_perfdata_physicaldisk_disk_time{instance="1 D:"} 1.250709e+06
# HELP windows_perfdata_physicaldisk_disk_transfers_sec Disk Transfers/sec is the rate of read and write operations on the disk.
# TYPE windows_perfdata_physicaldisk_disk_transfers_sec counter
windows_perfdata_physicaldisk_disk_transfers_sec{instance="0 C:"} 353015
windows_perfdata_physicaldisk_disk_transfers_sec{instance="1 D:"} 467
# HELP windows_perfdata_physicaldisk_disk_write_bytes_sec Disk Write Bytes/sec is rate at which bytes are transferred to the disk during write operations.
# TYPE windows_perfdata_physicaldisk_disk_write_bytes_sec counter
windows_perfdata_physicaldisk_disk_write_bytes_sec{instance="0 C:"} 9.304518144e+09
windows_perfdata_physicaldisk_disk_write_bytes_sec{instance="1 D:"} 6.9750784e+07
# HELP windows_perfdata_physicaldisk_disk_write_time % Disk Write Time is the percentage of elapsed time that the selected disk drive was busy servicing write requests.
# TYPE windows_perfdata_physicaldisk_disk_write_time counter
windows_perfdata_physicaldisk_disk_write_time{instance="0 C:"} 2.797723483e+09
windows_perfdata_physicaldisk_disk_write_time{instance="1 D:"} 1.239657e+06
# HELP windows_perfdata_physicaldisk_disk_writes_sec Disk Writes/sec is the rate of write operations on the disk.
# TYPE windows_perfdata_physicaldisk_disk_writes_sec counter
windows_perfdata_physicaldisk_disk_writes_sec{instance="0 C:"} 166862
windows_perfdata_physicaldisk_disk_writes_sec{instance="1 D:"} 462
# HELP windows_perfdata_physicaldisk_idle_time % Idle Time reports the percentage of time during the sample interval that the disk was idle.
# TYPE windows_perfdata_physicaldisk_idle_time counter
windows_perfdata_physicaldisk_idle_time{instance="0 C:"} 2.06008944912e+11
windows_perfdata_physicaldisk_idle_time{instance="1 D:"} 1.10519539422e+11
# HELP windows_perfdata_physicaldisk_split_io_sec Split IO/Sec reports the rate at which I/Os to the disk were split into multiple I/Os. A split I/O may result from requesting data of a size that is too large to fit into a single I/O or that the disk is fragmented.
# TYPE windows_perfdata_physicaldisk_split_io_sec counter
windows_perfdata_physicaldisk_split_io_sec{instance="0 C:"} 36951
windows_perfdata_physicaldisk_split_io_sec{instance="1 D:"} 81
# HELP windows_perfdata_processor_information_average_idle_time Average Idle Time is the average idle duration in 100ns units observed between the last two samples.
# TYPE windows_perfdata_processor_information_average_idle_time counter
windows_perfdata_processor_information_average_idle_time{instance="0,0"} 1.90679110216e+11
windows_perfdata_processor_information_average_idle_time{instance="0,1"} 1.90238386514e+11
windows_perfdata_processor_information_average_idle_time{instance="0,2"} 1.8836973038e+11
windows_perfdata_processor_information_average_idle_time{instance="0,3"} 1.90846844373e+11
# HELP windows_perfdata_processor_information_c1_time % C1 Time is the percentage of time the processor spends in the C1 low-power idle state. % C1 Time is a subset of the total processor idle time. C1 low-power idle state enables the processor to maintain its entire context and quickly return to the running state. Not all systems support the % C1 state.
# TYPE windows_perfdata_processor_information_c1_time counter
windows_perfdata_processor_information_c1_time{instance="0,0"} 3.864642111e+09
windows_perfdata_processor_information_c1_time{instance="0,1"} 3.748515435e+09
windows_perfdata_processor_information_c1_time{instance="0,2"} 3.98866083e+09
windows_perfdata_processor_information_c1_time{instance="0,3"} 3.459600632e+09
# HELP windows_perfdata_processor_information_c1_transitions_sec C1 Transitions/sec is the rate that the CPU enters the C1 low-power idle state. The CPU enters the C1 state when it is sufficiently idle and exits this state on any interrupt. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_c1_transitions_sec counter
windows_perfdata_processor_information_c1_transitions_sec{instance="0,0"} 775584
windows_perfdata_processor_information_c1_transitions_sec{instance="0,1"} 715109
windows_perfdata_processor_information_c1_transitions_sec{instance="0,2"} 795763
windows_perfdata_processor_information_c1_transitions_sec{instance="0,3"} 664601
# HELP windows_perfdata_processor_information_c2_time % C2 Time is the percentage of time the processor spends in the C2 low-power idle state. % C2 Time is a subset of the total processor idle time. C2 low-power idle state enables the processor to maintain the context of the system caches. The C2 power state is a lower power and higher exit latency state than C1. Not all systems support the C2 state.
# TYPE windows_perfdata_processor_information_c2_time counter
windows_perfdata_processor_information_c2_time{instance="0,0"} 1.86814468105e+11
windows_perfdata_processor_information_c2_time{instance="0,1"} 1.86489871079e+11
windows_perfdata_processor_information_c2_time{instance="0,2"} 1.8438106955e+11
windows_perfdata_processor_information_c2_time{instance="0,3"} 1.87387243741e+11
# HELP windows_perfdata_processor_information_c2_transitions_sec C2 Transitions/sec is the rate that the CPU enters the C2 low-power idle state. The CPU enters the C2 state when it is sufficiently idle and exits this state on any interrupt. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_c2_transitions_sec counter
windows_perfdata_processor_information_c2_transitions_sec{instance="0,0"} 1.2817407e+07
windows_perfdata_processor_information_c2_transitions_sec{instance="0,1"} 9.544548e+06
windows_perfdata_processor_information_c2_transitions_sec{instance="0,2"} 1.2354273e+07
windows_perfdata_processor_information_c2_transitions_sec{instance="0,3"} 9.334327e+06
# HELP windows_perfdata_processor_information_c3_time % C3 Time is the percentage of time the processor spends in the C3 low-power idle state. % C3 Time is a subset of the total processor idle time. When the processor is in the C3 low-power idle state it is unable to maintain the coherency of its caches. The C3 power state is a lower power and higher exit latency state than C2. Not all systems support the C3 state.
# TYPE windows_perfdata_processor_information_c3_time counter
windows_perfdata_processor_information_c3_time{instance="0,0"} 0
windows_perfdata_processor_information_c3_time{instance="0,1"} 0
windows_perfdata_processor_information_c3_time{instance="0,2"} 0
windows_perfdata_processor_information_c3_time{instance="0,3"} 0
# HELP windows_perfdata_processor_information_c3_transitions_sec C3 Transitions/sec is the rate that the CPU enters the C3 low-power idle state. The CPU enters the C3 state when it is sufficiently idle and exits this state on any interrupt. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_c3_transitions_sec counter
windows_perfdata_processor_information_c3_transitions_sec{instance="0,0"} 0
windows_perfdata_processor_information_c3_transitions_sec{instance="0,1"} 0
windows_perfdata_processor_information_c3_transitions_sec{instance="0,2"} 0
windows_perfdata_processor_information_c3_transitions_sec{instance="0,3"} 0
# HELP windows_perfdata_processor_information_clock_interrupts_sec Clock Interrupts/sec is the average rate, in incidents per second, at which the processor received and serviced clock tick interrupts. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_clock_interrupts_sec counter
windows_perfdata_processor_information_clock_interrupts_sec{instance="0,0"} 3.406837e+06
windows_perfdata_processor_information_clock_interrupts_sec{instance="0,1"} 2.904482e+06
windows_perfdata_processor_information_clock_interrupts_sec{instance="0,2"} 3.34509e+06
windows_perfdata_processor_information_clock_interrupts_sec{instance="0,3"} 2.894096e+06
# HELP windows_perfdata_processor_information_dpc_rate DPC Rate is the rate at which deferred procedure calls (DPCs) were added to the processors DPC queues between the timer ticks of the processor clock. DPCs are interrupts that run at alower priority than standard interrupts.  Each processor has its own DPC queue. This counter measures the rate that DPCs were added to the queue, not the number of DPCs in the queue. This counter displays the last observed value only; it is not an average.
# TYPE windows_perfdata_processor_information_dpc_rate gauge
windows_perfdata_processor_information_dpc_rate{instance="0,0"} 1
windows_perfdata_processor_information_dpc_rate{instance="0,1"} 0
windows_perfdata_processor_information_dpc_rate{instance="0,2"} 0
windows_perfdata_processor_information_dpc_rate{instance="0,3"} 0
# HELP windows_perfdata_processor_information_dpc_time % DPC Time is the percentage of time that the processor spent receiving and servicing deferred procedure calls (DPCs) during the sample interval. DPCs are interrupts that run at a lower priority than standard interrupts. % DPC Time is a component of % Privileged Time because DPCs are executed in privileged mode. They are counted separately and are not a component of the interrupt counters. This counter displays the average busy time as a percentage of the sample time.
# TYPE windows_perfdata_processor_information_dpc_time counter
windows_perfdata_processor_information_dpc_time{instance="0,0"} 2.20625e+08
windows_perfdata_processor_information_dpc_time{instance="0,1"} 781250
windows_perfdata_processor_information_dpc_time{instance="0,2"} 1.165625e+08
windows_perfdata_processor_information_dpc_time{instance="0,3"} 4.84375e+06
# HELP windows_perfdata_processor_information_dpcs_queued_sec DPCs Queued/sec is the average rate, in incidents per second, at which deferred procedure calls (DPCs) were added to the processor's DPC queue. DPCs are interrupts that run at a lower priority than standard interrupts.  Each processor has its own DPC queue. This counter measures the rate that DPCs are added to the queue, not the number of DPCs in the queue.  This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_dpcs_queued_sec counter
windows_perfdata_processor_information_dpcs_queued_sec{instance="0,0"} 1.316191e+06
windows_perfdata_processor_information_dpcs_queued_sec{instance="0,1"} 90107
windows_perfdata_processor_information_dpcs_queued_sec{instance="0,2"} 509658
windows_perfdata_processor_information_dpcs_queued_sec{instance="0,3"} 76256
# HELP windows_perfdata_processor_information_idle_break_events_sec Idle Break Events/sec is the average rate, in incidents per second, at which the processor wakes from idle.  This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_idle_break_events_sec counter
windows_perfdata_processor_information_idle_break_events_sec{instance="0,0"} 1.3592991e+07
windows_perfdata_processor_information_idle_break_events_sec{instance="0,1"} 1.0259657e+07
windows_perfdata_processor_information_idle_break_events_sec{instance="0,2"} 1.3150036e+07
windows_perfdata_processor_information_idle_break_events_sec{instance="0,3"} 9.998928e+06
# HELP windows_perfdata_processor_information_idle_time % Idle Time is the percentage of time the processor is idle during the sample interval
# TYPE windows_perfdata_processor_information_idle_time counter
windows_perfdata_processor_information_idle_time{instance="0,0"} 1.9384875e+11
windows_perfdata_processor_information_idle_time{instance="0,1"} 1.9359265625e+11
windows_perfdata_processor_information_idle_time{instance="0,2"} 1.9180640625e+11
windows_perfdata_processor_information_idle_time{instance="0,3"} 1.9408125e+11
# HELP windows_perfdata_processor_information_interrupt_time % Interrupt Time is the time the processor spends receiving and servicing hardware interrupts during sample intervals. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention. Normal thread execution is suspended during interrupts. Most system clocks interrupt the processor every 10 milliseconds, creating a background of interrupt activity. suspends normal thread execution during interrupts. This counter displays the average busy time as a percentage of the sample time.
# TYPE windows_perfdata_processor_information_interrupt_time counter
windows_perfdata_processor_information_interrupt_time{instance="0,0"} 4.703125e+07
windows_perfdata_processor_information_interrupt_time{instance="0,1"} 3.234375e+07
windows_perfdata_processor_information_interrupt_time{instance="0,2"} 3.828125e+07
windows_perfdata_processor_information_interrupt_time{instance="0,3"} 2.484375e+07
# HELP windows_perfdata_processor_information_interrupts_sec Interrupts/sec is the average rate, in incidents per second, at which the processor received and serviced hardware interrupts. It does not include deferred procedure calls (DPCs), which are counted separately. This value is an indirect indicator of the activity of devices that generate interrupts, such as the system clock, the mouse, disk drivers, data communication lines, network interface cards, and other peripheral devices. These devices normally interrupt the processor when they have completed a task or require attention. Normal thread execution is suspended. The system clock typically interrupts the processor every 10 milliseconds, creating a background of interrupt activity. This counter displays the difference between the values observed in the last two samples, divided by the duration of the sample interval.
# TYPE windows_perfdata_processor_information_interrupts_sec counter
windows_perfdata_processor_information_interrupts_sec{instance="0,0"} 1.8967097e+07
windows_perfdata_processor_information_interrupts_sec{instance="0,1"} 1.4416603e+07
windows_perfdata_processor_information_interrupts_sec{instance="0,2"} 1.7487563e+07
windows_perfdata_processor_information_interrupts_sec{instance="0,3"} 1.328594e+07
# HELP windows_perfdata_processor_information_of_maximum_frequency % of Maximum Frequency is the percentage of the current processor's maximum frequency. Some processors are capable of regulating their frequency outside of the control of Windows. % of Maximum Frequency will not accurately reflect actual processor frequency on these systems. Use % Processor Performance instead.
# TYPE windows_perfdata_processor_information_of_maximum_frequency gauge
windows_perfdata_processor_information_of_maximum_frequency{instance="0,0"} 100
windows_perfdata_processor_information_of_maximum_frequency{instance="0,1"} 100
windows_perfdata_processor_information_of_maximum_frequency{instance="0,2"} 100
windows_perfdata_processor_information_of_maximum_frequency{instance="0,3"} 100
# HELP windows_perfdata_processor_information_parking_status Parking Status represents whether a processor is parked or not.
# TYPE windows_perfdata_processor_information_parking_status gauge
windows_perfdata_processor_information_parking_status{instance="0,0"} 0
windows_perfdata_processor_information_parking_status{instance="0,1"} 0
windows_perfdata_processor_information_parking_status{instance="0,2"} 0
windows_perfdata_processor_information_parking_status{instance="0,3"} 0
# HELP windows_perfdata_processor_information_performance_limit % Performance Limit is the performance the processor guarantees it can provide, as a percentage of the nominal performance of the processor. Performance can be limited by Windows power policy, or by the platform as a result of a power budget, overheating, or other hardware issues.
# TYPE windows_perfdata_processor_information_performance_limit gauge
windows_perfdata_processor_information_performance_limit{instance="0,0"} 100
windows_perfdata_processor_information_performance_limit{instance="0,1"} 100
windows_perfdata_processor_information_performance_limit{instance="0,2"} 100
windows_perfdata_processor_information_performance_limit{instance="0,3"} 100
# HELP windows_perfdata_processor_information_performance_limit_flags Performance Limit Flags indicate reasons why the processor performance was limited.
# TYPE windows_perfdata_processor_information_performance_limit_flags gauge
windows_perfdata_processor_information_performance_limit_flags{instance="0,0"} 0
windows_perfdata_processor_information_performance_limit_flags{instance="0,1"} 0
windows_perfdata_processor_information_performance_limit_flags{instance="0,2"} 0
windows_perfdata_processor_information_performance_limit_flags{instance="0,3"} 0
# HELP windows_perfdata_processor_information_priority_time % Priority Time is the percentage of elapsed time that the processor spends executing threads that are not low priority. It is calculated by measuring the percentage of time that the processor spends executing low priority threads or the idle thread and then subtracting that value from 100%. (Each processor has an idle thread to which time is accumulated when no other threads are ready to run). This counter displays the average percentage of busy time observed during the sample interval excluding low priority background work. It should be noted that the accounting calculation of whether the processor is idle is performed at an internal sampling interval of the system clock tick. % Priority Time can therefore underestimate the processor utilization as the processor may be spending a lot of time servicing threads between the system clock sampling interval. Workload based timer applications are one example  of applications  which are more likely to be measured inaccurately as timers are signaled just after the sample is taken.
# TYPE windows_perfdata_processor_information_priority_time counter
windows_perfdata_processor_information_priority_time{instance="0,0"} 1.9399140625e+11
windows_perfdata_processor_information_priority_time{instance="0,1"} 1.93735625e+11
windows_perfdata_processor_information_priority_time{instance="0,2"} 1.9193703125e+11
windows_perfdata_processor_information_priority_time{instance="0,3"} 1.9418875e+11
# HELP windows_perfdata_processor_information_privileged_time % Privileged Time is the percentage of elapsed time that the process threads spent executing code in privileged mode.  When a Windows system service in called, the service will often run in privileged mode to gain access to system-private data. Such data is protected from access by threads executing in user mode. Calls to the system can be explicit or implicit, such as page faults or interrupts. Unlike some early operating systems, Windows uses process boundaries for subsystem protection in addition to the traditional protection of user and privileged modes. Some work done by Windows on behalf of the application might appear in other subsystem processes in addition to the privileged time in the process.
# TYPE windows_perfdata_processor_information_privileged_time counter
windows_perfdata_processor_information_privileged_time{instance="0,0"} 3.953125e+09
windows_perfdata_processor_information_privileged_time{instance="0,1"} 2.40421875e+09
windows_perfdata_processor_information_privileged_time{instance="0,2"} 3.40828125e+09
windows_perfdata_processor_information_privileged_time{instance="0,3"} 2.36953125e+09
# HELP windows_perfdata_processor_information_privileged_utility Privileged Utility is the amount of work a processor is completing while executing in privileged mode, as a percentage of the amount of work the processor could complete if it were running at its nominal performance and never idle. On some processors, Privileged Utility may exceed 100%.
# TYPE windows_perfdata_processor_information_privileged_utility gauge
windows_perfdata_processor_information_privileged_utility{instance="0,0"} 6.714863232e+09
windows_perfdata_processor_information_privileged_utility{instance="0,1"} 5.336443561e+09
windows_perfdata_processor_information_privileged_utility{instance="0,2"} 5.603121374e+09
windows_perfdata_processor_information_privileged_utility{instance="0,3"} 4.717553558e+09
# HELP windows_perfdata_processor_information_processor_frequency Processor Frequency is the frequency of the current processor in megahertz. Some processors are capable of regulating their frequency outside of the control of Windows. Processor Frequency will not accurately reflect actual processor frequency on these systems. Use % Processor Performance instead.
# TYPE windows_perfdata_processor_information_processor_frequency gauge
windows_perfdata_processor_information_processor_frequency{instance="0,0"} 2793
windows_perfdata_processor_information_processor_frequency{instance="0,1"} 2793
windows_perfdata_processor_information_processor_frequency{instance="0,2"} 2793
windows_perfdata_processor_information_processor_frequency{instance="0,3"} 2793
# HELP windows_perfdata_processor_information_processor_performance Processor Performance is the average performance of the processor while it is executing instructions, as a percentage of the nominal performance of the processor. On some processors, Processor Performance may exceed 100%. Some processors are capable of regulating their frequency outside of the control of Windows. Processor Performance will accurately reflect the performance of these processors.
# TYPE windows_perfdata_processor_information_processor_performance gauge
windows_perfdata_processor_information_processor_performance{instance="0,0"} 1.39697096809e+11
windows_perfdata_processor_information_processor_performance{instance="0,1"} 1.4359938844e+11
windows_perfdata_processor_information_processor_performance{instance="0,2"} 1.56575092733e+11
windows_perfdata_processor_information_processor_performance{instance="0,3"} 1.39740984104e+11
# HELP windows_perfdata_processor_information_processor_state_flags Processor State Flags
# TYPE windows_perfdata_processor_information_processor_state_flags gauge
windows_perfdata_processor_information_processor_state_flags{instance="0,0"} 1
windows_perfdata_processor_information_processor_state_flags{instance="0,1"} 1
windows_perfdata_processor_information_processor_state_flags{instance="0,2"} 1
windows_perfdata_processor_information_processor_state_flags{instance="0,3"} 1
# HELP windows_perfdata_processor_information_processor_time % Processor Time is the percentage of elapsed time that the processor spends to execute a non-Idle thread. It is calculated by measuring the percentage of time that the processor spends executing the idle thread and then subtracting that value from 100%. (Each processor has an idle thread to which time is accumulated when no other threads are ready to run). This counter is the primary indicator of processor activity, and displays the average percentage of busy time observed during the sample interval. It should be noted that the accounting calculation of whether the processor is idle is performed at an internal sampling interval of the system clock tick. On todays fast processors, % Processor Time can therefore underestimate the processor utilization as the processor may be spending a lot of time servicing threads between the system clock sampling interval. Workload based timer applications are one example  of applications  which are more likely to be measured inaccurately as timers are signaled just after the sample is taken.
# TYPE windows_perfdata_processor_information_processor_time counter
windows_perfdata_processor_information_processor_time{instance="0,0"} 1.9384875e+11
windows_perfdata_processor_information_processor_time{instance="0,1"} 1.9359265625e+11
windows_perfdata_processor_information_processor_time{instance="0,2"} 1.9180640625e+11
windows_perfdata_processor_information_processor_time{instance="0,3"} 1.9408125e+11
# HELP windows_perfdata_processor_information_processor_utility Processor Utility is the amount of work a processor is completing, as a percentage of the amount of work the processor could complete if it were running at its nominal performance and never idle. On some processors, Processor Utility may exceed 100%.
# TYPE windows_perfdata_processor_information_processor_utility gauge
windows_perfdata_processor_information_processor_utility{instance="0,0"} 1.39697096606e+11
windows_perfdata_processor_information_processor_utility{instance="0,1"} 1.43599387865e+11
windows_perfdata_processor_information_processor_utility{instance="0,2"} 1.56575092005e+11
windows_perfdata_processor_information_processor_utility{instance="0,3"} 1.39740983436e+11
# HELP windows_perfdata_processor_information_user_time % User Time is the percentage of elapsed time the processor spends in the user mode. User mode is a restricted processing mode designed for applications, environment subsystems, and integral subsystems.  The alternative, privileged mode, is designed for operating system components and allows direct access to hardware and all memory.  The operating system switches application threads to privileged mode to access operating system services. This counter displays the average busy time as a percentage of the sample time.
# TYPE windows_perfdata_processor_information_user_time counter
windows_perfdata_processor_information_user_time{instance="0,0"} 1.188390625e+10
windows_perfdata_processor_information_user_time{instance="0,1"} 1.368890625e+10
windows_perfdata_processor_information_user_time{instance="0,2"} 1.447109375e+10
windows_perfdata_processor_information_user_time{instance="0,3"} 1.323375e+10

In case it works well, some collectors will be migrate from perflib to PDH, too.

The PDH package is a modified version of https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
@jkroepke jkroepke requested a review from a team as a code owner April 27, 2024 13:46
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
@DerfOh
Copy link

DerfOh commented May 10, 2024

Any PerfData custom metrics can be implement now, without having the hard requirement of implement collector of each single subsystem.

Seems this might resolve #1414 as well

Copy link
Contributor

@breed808 breed808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work on getting this implemented! I've left a few minor questions, let me know if they require any clarification.

pkg/pdh/win_perf_counters.go Show resolved Hide resolved
pkg/pdh/win_perf_counters.go Show resolved Hide resolved
pkg/pdh/win_perf_counters.go Show resolved Hide resolved
pkg/perflib/const.go Outdated Show resolved Hide resolved
pkg/collector/perfdata/perfdata.go Outdated Show resolved Hide resolved
pkg/collector/perfdata/perfdata.go Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
@jkroepke jkroepke requested a review from breed808 May 11, 2024 07:04
…uters

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
@jkroepke jkroepke changed the title perfdata collector Add experimental generic perfdata collector May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom performance counters
3 participants