Check for listening exporter before querying
CI runs have exposed timing issues where promtool/e2e scripts query the exporter, before exporter has begun listening. Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
parent
6941ee7ab2
commit
79ecaf6a99
|
@ -30,8 +30,16 @@ $exporter_proc = Start-Process `
|
||||||
-RedirectStandardOutput "$($temp_dir)/windows_exporter.log" `
|
-RedirectStandardOutput "$($temp_dir)/windows_exporter.log" `
|
||||||
-RedirectStandardError "$($temp_dir)/windows_exporter_error.log"
|
-RedirectStandardError "$($temp_dir)/windows_exporter_error.log"
|
||||||
|
|
||||||
# Give exporter some time to start
|
# Exporter can take some time to start
|
||||||
Start-Sleep 15
|
for ($i=1; $i -le 5; $i++) {
|
||||||
|
Start-Sleep 10
|
||||||
|
|
||||||
|
$netstat_output = netstat -anp tcp | Select-String 'listening'
|
||||||
|
if ($netstat_output -like '*:9182*') {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
Write-Host "Waiting for exporter to start"
|
||||||
|
}
|
||||||
|
|
||||||
$response = Invoke-WebRequest -UseBasicParsing -URI http://127.0.0.1:9182/metrics
|
$response = Invoke-WebRequest -UseBasicParsing -URI http://127.0.0.1:9182/metrics
|
||||||
# Response output must be split and saved as UTF-8.
|
# Response output must be split and saved as UTF-8.
|
||||||
|
|
|
@ -98,8 +98,16 @@ $exporter_proc = Start-Process `
|
||||||
-RedirectStandardOutput "$($temp_dir)/windows_exporter.log" `
|
-RedirectStandardOutput "$($temp_dir)/windows_exporter.log" `
|
||||||
-RedirectStandardError "$($temp_dir)/windows_exporter_error.log"
|
-RedirectStandardError "$($temp_dir)/windows_exporter_error.log"
|
||||||
|
|
||||||
# Give exporter some time to start
|
# Exporter can take some time to start
|
||||||
Start-Sleep 15
|
for ($i=1; $i -le 5; $i++) {
|
||||||
|
Start-Sleep 10
|
||||||
|
|
||||||
|
$netstat_output = netstat -anp tcp | Select-String 'listening'
|
||||||
|
if ($netstat_output -like '*:9183*') {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
Write-Host "Waiting for exporter to start"
|
||||||
|
}
|
||||||
|
|
||||||
# Omit metrics from client_golang library; we're not responsible for these
|
# Omit metrics from client_golang library; we're not responsible for these
|
||||||
$skip_re = "^[#]?\s*(HELP|TYPE)?\s*go_"
|
$skip_re = "^[#]?\s*(HELP|TYPE)?\s*go_"
|
||||||
|
|
Loading…
Reference in New Issue