feat: increase time resolution when possible (collectors: os, system, time) (#2047)

This commit is contained in:
Lapo Luchini
2025-06-20 13:12:26 +02:00
committed by GitHub
parent 66cd489c4a
commit 59ac3072b1
8 changed files with 8 additions and 8 deletions

View File

@@ -142,7 +142,7 @@ func (c *Collector) collectWorker() {
name, pidString, parentPID, strconv.Itoa(int(processGroupID)), processOwner, cmdLine,
)
startTime := float64(time.Now().Unix() - int64(data.ElapsedTime))
startTime := float64(time.Now().UnixMicro())/1e6 - data.ElapsedTime
ch <- prometheus.MustNewConstMetric(
c.startTimeOld,