mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
udp: Added UDP collector (#1725)
This commit is contained in:
@@ -87,8 +87,6 @@ test_alpha_total 42
|
||||
# TYPE windows_cpu_interrupts_total counter
|
||||
# HELP windows_cpu_logical_processor Total number of logical processors
|
||||
# TYPE windows_cpu_logical_processor gauge
|
||||
# HELP windows_net_nic_address_info A metric with a constant '1' value labeled with the network interface's address information.
|
||||
# TYPE windows_net_nic_address_info gauge
|
||||
# HELP windows_cpu_parking_status Parking Status represents whether a processor is parked or not
|
||||
# TYPE windows_cpu_parking_status gauge
|
||||
# HELP windows_cpu_processor_mperf_total Processor MPerf is the number of TSC ticks incremented while executing instructions
|
||||
@@ -120,16 +118,21 @@ windows_exporter_collector_success{collector="cpu"} 1
|
||||
windows_exporter_collector_success{collector="cpu_info"} 1
|
||||
windows_exporter_collector_success{collector="cs"} 1
|
||||
windows_exporter_collector_success{collector="logical_disk"} 1
|
||||
windows_exporter_collector_success{collector="logon"} 1
|
||||
windows_exporter_collector_success{collector="memory"} 1
|
||||
windows_exporter_collector_success{collector="net"} 1
|
||||
windows_exporter_collector_success{collector="os"} 1
|
||||
windows_exporter_collector_success{collector="perfdata"} 1
|
||||
windows_exporter_collector_success{collector="physical_disk"} 1
|
||||
windows_exporter_collector_success{collector="printer"} 1
|
||||
windows_exporter_collector_success{collector="process"} 1
|
||||
windows_exporter_collector_success{collector="scheduled_task"} 1
|
||||
windows_exporter_collector_success{collector="service"} 1
|
||||
windows_exporter_collector_success{collector="system"} 1
|
||||
windows_exporter_collector_success{collector="tcp"} 1
|
||||
windows_exporter_collector_success{collector="textfile"} 1
|
||||
windows_exporter_collector_success{collector="time"} 1
|
||||
windows_exporter_collector_success{collector="udp"} 1
|
||||
# HELP windows_exporter_collector_timeout windows_exporter: Whether the collector timed out.
|
||||
# TYPE windows_exporter_collector_timeout gauge
|
||||
windows_exporter_collector_timeout{collector="cache"} 0
|
||||
@@ -137,16 +140,21 @@ windows_exporter_collector_timeout{collector="cpu"} 0
|
||||
windows_exporter_collector_timeout{collector="cpu_info"} 0
|
||||
windows_exporter_collector_timeout{collector="cs"} 0
|
||||
windows_exporter_collector_timeout{collector="logical_disk"} 0
|
||||
windows_exporter_collector_timeout{collector="logon"} 0
|
||||
windows_exporter_collector_timeout{collector="memory"} 0
|
||||
windows_exporter_collector_timeout{collector="net"} 0
|
||||
windows_exporter_collector_timeout{collector="os"} 0
|
||||
windows_exporter_collector_timeout{collector="perfdata"} 0
|
||||
windows_exporter_collector_timeout{collector="physical_disk"} 0
|
||||
windows_exporter_collector_timeout{collector="printer"} 0
|
||||
windows_exporter_collector_timeout{collector="process"} 0
|
||||
windows_exporter_collector_timeout{collector="scheduled_task"} 0
|
||||
windows_exporter_collector_timeout{collector="service"} 0
|
||||
windows_exporter_collector_timeout{collector="system"} 0
|
||||
windows_exporter_collector_timeout{collector="tcp"} 0
|
||||
windows_exporter_collector_timeout{collector="textfile"} 0
|
||||
windows_exporter_collector_timeout{collector="time"} 0
|
||||
windows_exporter_collector_timeout{collector="udp"} 0
|
||||
# HELP windows_exporter_perflib_snapshot_duration_seconds Duration of perflib snapshot capture
|
||||
# TYPE windows_exporter_perflib_snapshot_duration_seconds gauge
|
||||
# HELP windows_exporter_scrape_duration_seconds windows_exporter: Total scrape duration.
|
||||
@@ -185,6 +193,8 @@ windows_exporter_collector_timeout{collector="textfile"} 0
|
||||
# TYPE windows_logical_disk_write_seconds_total counter
|
||||
# HELP windows_logical_disk_writes_total The number of write operations on the disk (LogicalDisk.DiskWritesPerSec)
|
||||
# TYPE windows_logical_disk_writes_total counter
|
||||
# HELP windows_logon_session_logon_timestamp_seconds timestamp of the logon session in seconds.
|
||||
# TYPE windows_logon_session_logon_timestamp_seconds gauge
|
||||
# HELP windows_memory_available_bytes The amount of physical memory immediately available for allocation to a process or for system use. It is equal to the sum of memory assigned to the standby (cached), free and zero page lists (AvailableBytes)
|
||||
# TYPE windows_memory_available_bytes gauge
|
||||
# HELP windows_memory_cache_bytes (CacheBytes)
|
||||
@@ -229,15 +239,15 @@ windows_exporter_collector_timeout{collector="textfile"} 0
|
||||
# TYPE windows_memory_standby_cache_normal_priority_bytes gauge
|
||||
# HELP windows_memory_standby_cache_reserve_bytes The amount of physical memory, in bytes, that is assigned to the reserve standby cache page lists. This memory contains cached data and code that is not actively in use by processes, the system and the system cache (StandbyCacheReserveBytes)
|
||||
# TYPE windows_memory_standby_cache_reserve_bytes gauge
|
||||
# HELP windows_memory_swap_page_operations_total Total number of swap page read and writes (PagesPersec)
|
||||
# HELP windows_memory_swap_page_operations_total Total number of swap page read and writes (PagesPerSec)
|
||||
# TYPE windows_memory_swap_page_operations_total counter
|
||||
# HELP windows_memory_swap_page_reads_total Number of disk page reads (a single read operation reading several pages is still only counted once) (PageReadsPersec)
|
||||
# HELP windows_memory_swap_page_reads_total Number of disk page reads (a single read operation reading several pages is still only counted once) (PageReadsPerSec)
|
||||
# TYPE windows_memory_swap_page_reads_total counter
|
||||
# HELP windows_memory_swap_page_writes_total Number of disk page writes (a single write operation writing several pages is still only counted once) (PageWritesPersec)
|
||||
# HELP windows_memory_swap_page_writes_total Number of disk page writes (a single write operation writing several pages is still only counted once) (PageWritesPerSec)
|
||||
# TYPE windows_memory_swap_page_writes_total counter
|
||||
# HELP windows_memory_swap_pages_read_total Number of pages read across all page reads (ie counting all pages read even if they are read in a single operation) (PagesInputPersec)
|
||||
# HELP windows_memory_swap_pages_read_total Number of pages read across all page reads (ie counting all pages read even if they are read in a single operation) (PagesInputPerSec)
|
||||
# TYPE windows_memory_swap_pages_read_total counter
|
||||
# HELP windows_memory_swap_pages_written_total Number of pages written across all page writes (ie counting all pages written even if they are written in a single operation) (PagesOutputPersec)
|
||||
# HELP windows_memory_swap_pages_written_total Number of pages written across all page writes (ie counting all pages written even if they are written in a single operation) (PagesOutputPerSec)
|
||||
# TYPE windows_memory_swap_pages_written_total counter
|
||||
# HELP windows_memory_system_cache_resident_bytes The size, in bytes, of the portion of the system file cache which is currently resident and active in physical memory (SystemCacheResidentBytes)
|
||||
# TYPE windows_memory_system_cache_resident_bytes gauge
|
||||
@@ -249,11 +259,11 @@ windows_exporter_collector_timeout{collector="textfile"} 0
|
||||
# TYPE windows_memory_system_driver_resident_bytes gauge
|
||||
# HELP windows_memory_system_driver_total_bytes The size, in bytes, of the pageable virtual memory currently being used by device drivers. Pageable memory can be written to disk when it is not being used (SystemDriverTotalBytes)
|
||||
# TYPE windows_memory_system_driver_total_bytes gauge
|
||||
# HELP windows_memory_transition_faults_total Number of faults rate at which page faults are resolved by recovering pages that were being used by another process sharing the page, or were on the modified page list or the standby list, or were being written to disk at the time of the page fault (TransitionFaultsPersec)
|
||||
# HELP windows_memory_transition_faults_total Number of faults rate at which page faults are resolved by recovering pages that were being used by another process sharing the page, or were on the modified page list or the standby list, or were being written to disk at the time of the page fault (TransitionFaultsPerSec)
|
||||
# TYPE windows_memory_transition_faults_total counter
|
||||
# HELP windows_memory_transition_pages_repurposed_total Transition Pages RePurposed is the rate at which the number of transition cache pages were reused for a different purpose (TransitionPagesRePurposedPersec)
|
||||
# HELP windows_memory_transition_pages_repurposed_total Transition Pages RePurposed is the rate at which the number of transition cache pages were reused for a different purpose (TransitionPagesRePurposedPerSec)
|
||||
# TYPE windows_memory_transition_pages_repurposed_total counter
|
||||
# HELP windows_memory_write_copies_total The number of page faults caused by attempting to write that were satisfied by copying the page from elsewhere in physical memory (WriteCopiesPersec)
|
||||
# HELP windows_memory_write_copies_total The number of page faults caused by attempting to write that were satisfied by copying the page from elsewhere in physical memory (WriteCopiesPerSec)
|
||||
# TYPE windows_memory_write_copies_total counter
|
||||
# HELP windows_net_bytes_received_total (Network.BytesReceivedPerSec)
|
||||
# TYPE windows_net_bytes_received_total counter
|
||||
@@ -263,6 +273,8 @@ windows_exporter_collector_timeout{collector="textfile"} 0
|
||||
# TYPE windows_net_bytes_total counter
|
||||
# HELP windows_net_current_bandwidth_bytes (Network.CurrentBandwidth)
|
||||
# TYPE windows_net_current_bandwidth_bytes gauge
|
||||
# HELP windows_net_nic_address_info A metric with a constant '1' value labeled with the network interface's address information.
|
||||
# TYPE windows_net_nic_address_info gauge
|
||||
# HELP windows_net_output_queue_length_packets (Network.OutputQueueLength)
|
||||
# TYPE windows_net_output_queue_length_packets gauge
|
||||
# HELP windows_net_packets_outbound_discarded_total (Network.PacketsOutboundDiscarded)
|
||||
@@ -339,16 +351,26 @@ windows_exporter_collector_timeout{collector="textfile"} 0
|
||||
# TYPE windows_physical_disk_write_seconds_total counter
|
||||
# HELP windows_physical_disk_writes_total The number of write operations on the disk (PhysicalDisk.DiskWritesPerSec)
|
||||
# TYPE windows_physical_disk_writes_total counter
|
||||
# HELP windows_printer_job_count Number of jobs processed by the printer since the last reset
|
||||
# TYPE windows_printer_job_count counter
|
||||
# HELP windows_printer_status Printer status
|
||||
# TYPE windows_printer_status gauge
|
||||
# HELP windows_scheduled_task_last_result The result that was returned the last time the registered task was run
|
||||
# TYPE windows_scheduled_task_last_result gauge
|
||||
windows_scheduled_task_last_result{task="/Microsoft/Windows/PLA/GAEvents"} 0
|
||||
# HELP windows_scheduled_task_missed_runs The number of times the registered task missed a scheduled run
|
||||
# TYPE windows_scheduled_task_missed_runs gauge
|
||||
windows_scheduled_task_missed_runs{task="/Microsoft/Windows/PLA/GAEvents"} 0
|
||||
# HELP windows_scheduled_task_state The current state of a scheduled task
|
||||
# TYPE windows_scheduled_task_state gauge
|
||||
windows_scheduled_task_state{state="disabled",task="/Microsoft/Windows/Maintenance/WinSAT"} 1
|
||||
windows_scheduled_task_state{state="queued",task="/Microsoft/Windows/Maintenance/WinSAT"} 0
|
||||
windows_scheduled_task_state{state="ready",task="/Microsoft/Windows/Maintenance/WinSAT"} 0
|
||||
windows_scheduled_task_state{state="running",task="/Microsoft/Windows/Maintenance/WinSAT"} 0
|
||||
windows_scheduled_task_state{state="unknown",task="/Microsoft/Windows/Maintenance/WinSAT"} 0
|
||||
windows_scheduled_task_state{state="disabled",task="/Microsoft/Windows/PLA/GAEvents"} 0
|
||||
windows_scheduled_task_state{state="queued",task="/Microsoft/Windows/PLA/GAEvents"} 0
|
||||
windows_scheduled_task_state{state="ready",task="/Microsoft/Windows/PLA/GAEvents"} 0
|
||||
windows_scheduled_task_state{state="running",task="/Microsoft/Windows/PLA/GAEvents"} 1
|
||||
windows_scheduled_task_state{state="unknown",task="/Microsoft/Windows/PLA/GAEvents"} 0
|
||||
# HELP windows_service_info A metric with a constant '1' value labeled with service information
|
||||
# TYPE windows_service_info gauge
|
||||
windows_service_info{display_name="Themes",name="Themes",path_name="C:\\WINDOWS\\System32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1
|
||||
windows_service_info{display_name="Themes",name="Themes",path_name="C:\\Windows\\System32\\svchost.exe -k netsvcs -p",run_as="LocalSystem"} 1
|
||||
# HELP windows_service_process Process of started service. The value is the creation time of the process as a unix timestamp.
|
||||
# TYPE windows_service_process gauge
|
||||
# HELP windows_service_start_mode The start mode of the service (StartMode)
|
||||
@@ -383,9 +405,53 @@ windows_service_state{name="Themes",state="stopped"} 0
|
||||
# TYPE windows_system_system_up_time gauge
|
||||
# HELP windows_system_threads Current number of threads (WMI source: PerfOS_System.Threads)
|
||||
# TYPE windows_system_threads gauge
|
||||
# HELP windows_tcp_connection_failures_total (TCP.ConnectionFailures)
|
||||
# TYPE windows_tcp_connection_failures_total counter
|
||||
# HELP windows_tcp_connections_active_total (TCP.ConnectionsActive)
|
||||
# TYPE windows_tcp_connections_active_total counter
|
||||
# HELP windows_tcp_connections_established (TCP.ConnectionsEstablished)
|
||||
# TYPE windows_tcp_connections_established gauge
|
||||
# HELP windows_tcp_connections_passive_total (TCP.ConnectionsPassive)
|
||||
# TYPE windows_tcp_connections_passive_total counter
|
||||
# HELP windows_tcp_connections_reset_total (TCP.ConnectionsReset)
|
||||
# TYPE windows_tcp_connections_reset_total counter
|
||||
# HELP windows_tcp_connections_state_count Number of TCP connections by state and address family
|
||||
# TYPE windows_tcp_connections_state_count gauge
|
||||
# HELP windows_tcp_segments_received_total (TCP.SegmentsReceivedTotal)
|
||||
# TYPE windows_tcp_segments_received_total counter
|
||||
# HELP windows_tcp_segments_retransmitted_total (TCP.SegmentsRetransmittedTotal)
|
||||
# TYPE windows_tcp_segments_retransmitted_total counter
|
||||
# HELP windows_tcp_segments_sent_total (TCP.SegmentsSentTotal)
|
||||
# TYPE windows_tcp_segments_sent_total counter
|
||||
# HELP windows_tcp_segments_total (TCP.SegmentsTotal)
|
||||
# TYPE windows_tcp_segments_total counter
|
||||
# HELP windows_textfile_mtime_seconds Unixtime mtime of textfiles successfully read.
|
||||
# TYPE windows_textfile_mtime_seconds gauge
|
||||
# HELP windows_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise
|
||||
# TYPE windows_textfile_scrape_error gauge
|
||||
windows_textfile_scrape_error 0
|
||||
# HELP windows_time_clock_frequency_adjustment_ppb_total Total adjustment made to the local system clock frequency by W32Time in Parts Per Billion (PPB) units.
|
||||
# TYPE windows_time_clock_frequency_adjustment_ppb_total counter
|
||||
# HELP windows_time_computed_time_offset_seconds Absolute time offset between the system clock and the chosen time source, in seconds
|
||||
# TYPE windows_time_computed_time_offset_seconds gauge
|
||||
# HELP windows_time_current_timestamp_seconds OperatingSystem.LocalDateTime
|
||||
# TYPE windows_time_current_timestamp_seconds gauge
|
||||
# HELP windows_time_ntp_client_time_sources Active number of NTP Time sources being used by the client
|
||||
# TYPE windows_time_ntp_client_time_sources gauge
|
||||
# HELP windows_time_ntp_round_trip_delay_seconds Roundtrip delay experienced by the NTP client in receiving a response from the server for the most recent request, in seconds
|
||||
# TYPE windows_time_ntp_round_trip_delay_seconds gauge
|
||||
# HELP windows_time_ntp_server_incoming_requests_total Total number of requests received by NTP server
|
||||
# TYPE windows_time_ntp_server_incoming_requests_total counter
|
||||
# HELP windows_time_ntp_server_outgoing_responses_total Total number of requests responded to by NTP server
|
||||
# TYPE windows_time_ntp_server_outgoing_responses_total counter
|
||||
# HELP windows_time_timezone OperatingSystem.LocalDateTime
|
||||
# TYPE windows_time_timezone gauge
|
||||
# HELP windows_udp_datagram_no_port_total Number of received UDP datagrams for which there was no application at the destination port
|
||||
# TYPE windows_udp_datagram_no_port_total counter
|
||||
# HELP windows_udp_datagram_received_errors_total Number of received UDP datagrams that could not be delivered for reasons other than the lack of an application at the destination port
|
||||
# TYPE windows_udp_datagram_received_errors_total counter
|
||||
# HELP windows_udp_datagram_received_total UDP datagrams are delivered to UDP users
|
||||
# TYPE windows_udp_datagram_received_total gauge
|
||||
# HELP windows_udp_datagram_sent_total UDP datagrams are sent from the entity
|
||||
# TYPE windows_udp_datagram_sent_total counter
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ if (-not (Test-Path -Path '..\windows_exporter.exe')) {
|
||||
Write-Output "..\windows_exporter.exe not found. Consider running \`go build\` first"
|
||||
}
|
||||
|
||||
$temp_dir = Join-Path $env:TEMP $(New-Guid) | ForEach-Object { mkdir $_ }
|
||||
$temp_dir = Join-Path $env:TEMP $([guid]::newguid()) | ForEach-Object { mkdir $_ }
|
||||
|
||||
# Create temporary directory for textfile collector
|
||||
$textfile_dir = "$($temp_dir)/textfile"
|
||||
@@ -18,14 +18,14 @@ mkdir $textfile_dir | Out-Null
|
||||
Copy-Item 'e2e-textfile.prom' -Destination "$($textfile_dir)/e2e-textfile.prom"
|
||||
|
||||
# Omit dynamic collector information that will change after each run
|
||||
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_perflib_snapshot_duration_seconds|windows_exporter_scrape_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_cache|windows_logical_disk|windows_physical_disk|windows_memory|windows_net|windows_os|windows_process|windows_service_process|windows_system|windows_perfdata|windows_textfile_mtime_seconds)"
|
||||
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_perflib_snapshot_duration_seconds|windows_exporter_scrape_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_cache|windows_logon|windows_logical_disk|windows_physical_disk|windows_memory|windows_net|windows_os|windows_process|windows_service_process|windows_printer|windows_udp|windows_tcp|windows_system|windows_time|windows_session|windows_perfdata|windows_textfile_mtime_seconds)"
|
||||
|
||||
# Start process in background, awaiting HTTP requests.
|
||||
# Use default collectors, port and address: http://localhost:9182/metrics
|
||||
$exporter_proc = Start-Process `
|
||||
-PassThru `
|
||||
-FilePath ..\windows_exporter.exe `
|
||||
-ArgumentList "--log.level=debug","--web.disable-exporter-metrics","--collectors.enabled=[defaults],cache,cpu_info,textfile,process,perfdata,scheduled_task","--collector.process.include=explorer.exe","--collector.scheduled_task.include=.*WinSAT","--collector.service.include=Themes","--collector.textfile.directories=$($textfile_dir)",@"
|
||||
-ArgumentList "--log.level=debug","--web.disable-exporter-metrics","--collectors.enabled=[defaults],cpu_info,textfile,process,perfdata,scheduled_task,tcp,udp,time,system,service,logical_disk,printer,os,net,memory,logon,cache","--collector.process.include=explorer.exe","--collector.scheduled_task.include=.*GAEvents","--collector.service.include=Themes","--collector.textfile.directories=$($textfile_dir)",@"
|
||||
--collector.perfdata.objects="[{\"object\":\"Processor Information\",\"instance_label\":\"core\",\"instances\":[\"*\"],\"counters\":{\"% Processor Time\":{},\"% Privileged Time\":{}}},{\"object\":\"Memory\",\"counters\":{\"Cache Faults/sec\":{\"type\":\"counter\"}}}]"
|
||||
"@ `
|
||||
-WindowStyle Hidden `
|
||||
|
||||
@@ -85,7 +85,7 @@ $script_path = $MyInvocation.MyCommand.Path
|
||||
$working_dir = Split-Path $script_path
|
||||
Push-Location $working_dir
|
||||
|
||||
$temp_dir = Join-Path $env:TEMP $(New-Guid) | ForEach-Object { mkdir $_ }
|
||||
$temp_dir = Join-Path $env:TEMP $([guid]::newguid()) | ForEach-Object { mkdir $_ }
|
||||
|
||||
# Start process in background, awaiting HTTP requests.
|
||||
# Listen on 9183/TCP, preventing conflicts with 9182/TCP used by end-to-end-test.ps1
|
||||
@@ -113,13 +113,29 @@ for ($i=1; $i -le 5; $i++) {
|
||||
# windows_memory_pool_nonpaged_allocs_total is wrong for years. It's not a gauge, but a counter.
|
||||
$skip_re = "^([#]?\s*(HELP|TYPE)?\s*go_|windows_memory_pool_nonpaged_allocs_total)"
|
||||
|
||||
# Need to remove carriage returns, as promtool expects LF line endings
|
||||
$output = ((Invoke-WebRequest -UseBasicParsing -URI http://127.0.0.1:9183/metrics).Content) -Split "`r?`n" | Select-String -NotMatch $skip_re | Join-String -Separator "`n"
|
||||
# Join the split lines back to a single String (with LF line endings!)
|
||||
$output = $output -Join "`n"
|
||||
Stop-Process -Id $exporter_proc.Id
|
||||
try {
|
||||
# Need to remove carriage returns, as promtool expects LF line endings
|
||||
$output = ((Invoke-WebRequest -UseBasicParsing -URI http://127.0.0.1:9183/metrics).Content) -Split "`r?`n" | Select-String -NotMatch $skip_re | Join-String -Separator "`n"
|
||||
# $output = (((Invoke-WebRequest -UseBasicParsing -URI http://127.0.0.1:9183/metrics).Content) -Split "`r?`n" | Select-String -NotMatch $skip_re) -join "`n"
|
||||
# Join the split lines back to a single String (with LF line endings!)
|
||||
$output = $output -Join "`n"
|
||||
|
||||
Stop-Process -Id $exporter_proc.Id
|
||||
} catch {
|
||||
Write-Host "STDOUT"
|
||||
Get-Content "$($temp_dir)/windows_exporter.log"
|
||||
Write-Host "STDERR"
|
||||
Get-Content "$($temp_dir)/windows_exporter_error.log"
|
||||
|
||||
throw $_
|
||||
}
|
||||
|
||||
$ExitCode = Start-RawProcess -InputVar $output -CommandName promtool.exe -CommandArgs @("check metrics")
|
||||
if ($ExitCode -ne 0) {
|
||||
Write-Host "OUTPUT"
|
||||
|
||||
Write-Host $output
|
||||
|
||||
Write-Host "Promtool command returned exit code $($ExitCode). See output for details."
|
||||
EXIT 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user