Merge pull request #689 from breed808/time_doc

Document version requirement for time collector
This commit is contained in:
Ben Reedy
2021-01-22 17:58:29 +10:00
committed by GitHub
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{

View File

@@ -3,6 +3,8 @@
The time collector exposes the Windows Time Service metrics. Note that the Windows Time Service must be running, else metric collection will fail.
If the Windows Time Service is stopped after collection has started, collector metric values will reset to 0.
Please note the Time Service perflib counters are only available on [Windows Server 2016 or newer](https://docs.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-server-2016-improvements).
|||
-|-
Metric name prefix | `time`