Document version requirement for time collector

Windows Server 2016 or newer is required for the collector, as the
perflib counters were not exposed in previous versions.

Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
Ben Reedy
2020-12-30 20:09:18 +10:00
parent 6b8e9bee3f
commit 8407f4aeb8
2 changed files with 8 additions and 0 deletions

View File

@@ -3,6 +3,8 @@
package collector
import (
"errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
)
@@ -22,6 +24,10 @@ type TimeCollector struct {
}
func newTimeCollector() (Collector, error) {
if getWindowsVersion() <= 6.1 {
return nil, errors.New("Windows version older than Server 2016 detected. The time collector will not run and should be disabled via CLI flags or configuration file")
}
const subsystem = "time"
return &TimeCollector{