mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-25 13:09:03 +01:00
collector: bound MI probe queries in Build with a timeout (#2657)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1302cf6899
commit
465fccbe69
@@ -29,6 +29,12 @@ import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
// BuildQueryTimeout bounds the probe queries collectors run in Build. Build
|
||||
// has no scrape budget, and a zero timeout sets no MI timeout, so a stalled
|
||||
// provider would otherwise block startup. A timed-out query fails with
|
||||
// MI_RESULT_INVALID_OPERATION_TIMEOUT. MI ignores timeouts below 1ms.
|
||||
const BuildQueryTimeout = 30 * time.Second
|
||||
|
||||
// Session represents a session.
|
||||
//
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/mi/ns-mi-mi_session
|
||||
|
||||
Reference in New Issue
Block a user