From 7c14a79ef29d1a2e32854ccb50d6f5f11481bd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 21 Jun 2025 11:28:48 +0200 Subject: [PATCH] [0.30] service: report invalid parameter errors as debug (#2051) (#2092) --- internal/collector/service/service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/collector/service/service.go b/internal/collector/service/service.go index 5416e3a8..d60894fc 100644 --- a/internal/collector/service/service.go +++ b/internal/collector/service/service.go @@ -350,7 +350,9 @@ func (c *Collector) collectService(ch chan<- prometheus.Metric, serviceName stri logLevel := slog.LevelWarn - if errors.Is(err, windows.ERROR_ACCESS_DENIED) { + // ERROR_INVALID_PARAMETER returns when the process is not running. This can be happened + // if the service terminated after query the service API. + if errors.Is(err, windows.ERROR_ACCESS_DENIED) || errors.Is(err, windows.ERROR_INVALID_PARAMETER) { logLevel = slog.LevelDebug }