Merge pull request #1446 from jkroepke/fix-windows2012

This commit is contained in:
Jan-Otto Kröpke
2024-04-21 08:46:44 +02:00
committed by GitHub

View File

@@ -3,6 +3,7 @@
package os
import (
"errors"
"fmt"
"os"
"strings"
@@ -224,7 +225,9 @@ func (c *collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
}
revision, _, err := ntKey.GetIntegerValue("UBR")
if err != nil {
if errors.Is(err, registry.ErrNotExist) {
revision = 0
} else if err != nil {
return nil, err
}