mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
Add CI support for textfile collector
Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
@@ -12,15 +12,20 @@ Push-Location $working_dir
|
||||
|
||||
$temp_dir = Join-Path $env:TEMP $(New-Guid) | ForEach-Object { mkdir $_ }
|
||||
|
||||
# Create temporary directory for textfile collector
|
||||
$textfile_dir = "$($temp_dir)/textfile"
|
||||
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|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_logical_disk|windows_net|windows_os|windows_service|windows_system)"
|
||||
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_perflib_snapshot_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_logical_disk|windows_net|windows_os|windows_service|windows_system|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' `
|
||||
-ArgumentList "--log.level=debug --collector.textfile.directory=$($textfile_dir)" `
|
||||
-WindowStyle Hidden `
|
||||
-RedirectStandardOutput "$($temp_dir)/windows_exporter.log" `
|
||||
-RedirectStandardError "$($temp_dir)/windows_exporter_error.log"
|
||||
|
||||
Reference in New Issue
Block a user