Skip to content

Commit 81adda5

Browse files
authored
fix(probe): System/Time/Clock moved on top of probe list for better timestamp accuracy (#144)
1 parent 33e2efa commit 81adda5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/probe/probe.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ func (p *ProbeCollector) Probe(ctx context.Context, target string, hc *http.Clie
103103
// TODO: Make parallel
104104
success := true
105105
for _, aProbe := range []probeDetailedFunc{
106+
// Always keep probeSystemTime on top of the list to have the probe processed first.
107+
// Therefore time returned is more accurate when integrated in Prometheus because
108+
// timestamp for the metrics probe, in Prometheus, is obtained from the query time, not the reply time.
109+
// This is especially important when running all the probes takes many seconds.
110+
{"System/Time/Clock", probeSystemTime},
106111
{"BGP/NeighborPaths/IPv4", probeBGPNeighborPathsIPv4},
107112
{"BGP/NeighborPaths/IPv6", probeBGPNeighborPathsIPv6},
108113
{"BGP/Neighbors/IPv4", probeBGPNeighborsIPv4},
@@ -119,7 +124,6 @@ func (p *ProbeCollector) Probe(ctx context.Context, target string, hc *http.Clie
119124
{"System/LinkMonitor", probeSystemLinkMonitor},
120125
{"System/Resource/Usage", probeSystemResourceUsage},
121126
{"System/Status", probeSystemStatus},
122-
{"System/Time/Clock", probeSystemTime},
123127
{"System/VDOMResources", probeSystemVDOMResources},
124128
{"User/Fsso", probeUserFsso},
125129
{"VPN/IPSec", probeVPNIPSec},

0 commit comments

Comments
 (0)