Skip to content

Commit 2f20a9b

Browse files
authored
Merge pull request #2603 from prometheus/superq/deprecate_ntp
Deprecate ntp collector
2 parents c42d046 + c8705ec commit 2f20a9b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ logind | Exposes session counts from [logind](http://www.freedesktop.org/wiki/So
165165
meminfo\_numa | Exposes memory statistics from `/proc/meminfo_numa`. | Linux
166166
mountstats | Exposes filesystem statistics from `/proc/self/mountstats`. Exposes detailed NFS client statistics. | Linux
167167
network_route | Exposes the routing table as metrics | Linux
168-
ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_
169168
perf | Exposes perf based metrics (Warning: Metrics are dependent on kernel configuration and settings). | Linux
170169
processes | Exposes aggregate process statistics from `/proc`. | Linux
171170
qdisc | Exposes [queuing discipline](https://en.wikipedia.org/wiki/Network_scheduler#Linux_kernel) statistics | Linux
@@ -178,6 +177,14 @@ tcpstat | Exposes TCP connection status information from `/proc/net/tcp` and `/p
178177
wifi | Exposes WiFi device and station statistics. | Linux
179178
zoneinfo | Exposes NUMA memory zone metrics. | Linux
180179

180+
### Deprecated
181+
182+
These colectors are deprecated and will be removed in the next major release.
183+
184+
Name | Description | OS
185+
---------|-------------|----
186+
ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_
187+
181188
### Perf Collector
182189

183190
The `perf` collector may not work out of the box on some Linux systems due to kernel

collector/ntp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/alecthomas/kingpin/v2"
2626
"github.com/beevik/ntp"
2727
"github.com/go-kit/log"
28+
"github.com/go-kit/log/level"
2829
"github.com/prometheus/client_golang/prometheus"
2930
)
3031

@@ -79,6 +80,7 @@ func NewNtpCollector(logger log.Logger) (Collector, error) {
7980
return nil, fmt.Errorf("invalid NTP port number %d; must be between 1 and 65535 inclusive", *ntpServerPort)
8081
}
8182

83+
level.Warn(logger).Log("msg", "This collector is deprecated and will be removed in the next major version release.")
8284
return &ntpCollector{
8385
stratum: typedDesc{prometheus.NewDesc(
8486
prometheus.BuildFQName(namespace, ntpSubsystem, "stratum"),

docs/TIME.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## `ntp` collector
44

5+
NOTE: This collector is deprecated and will be removed in the next major version release.
6+
57
This collector is intended for usage with local NTP daemons including [ntp.org](http://ntp.org/), [chrony](https://chrony.tuxfamily.org/comparison.html), and [OpenNTPD](http://www.openntpd.org/).
68

79
Note, some chrony packages have `local stratum 10` configuration value making chrony a valid server when it is unsynchronised. This configuration makes one of the heuristics that derive `node_ntp_sanity` unreliable.

0 commit comments

Comments
 (0)