mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Export timestamps in seconds since epoch.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
parent
84df210c41
commit
37ad4db485
|
@ -126,7 +126,7 @@ var (
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "queue_highest_sent_timestamp",
|
Name: "queue_highest_sent_timestamp",
|
||||||
Help: "Timestamp from a WAL sample, the highest timestamp successfully sent by this queue.",
|
Help: "Timestamp from a WAL sample, the highest timestamp successfully sent by this queue, in seconds since epoch.",
|
||||||
},
|
},
|
||||||
[]string{queue},
|
[]string{queue},
|
||||||
)
|
)
|
||||||
|
@ -524,7 +524,7 @@ func (t *QueueManager) setHighestSentTimestamp(highest int64) {
|
||||||
defer t.timestampLock.Unlock()
|
defer t.timestampLock.Unlock()
|
||||||
if highest > t.highestSentTimestamp {
|
if highest > t.highestSentTimestamp {
|
||||||
t.highestSentTimestamp = highest
|
t.highestSentTimestamp = highest
|
||||||
t.highestSentTimestampMetric.Set(float64(t.highestSentTimestamp))
|
t.highestSentTimestampMetric.Set(float64(t.highestSentTimestamp) / 1000.)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ func NewStorage(l log.Logger, reg prometheus.Registerer, stCallback startTimeCal
|
||||||
}),
|
}),
|
||||||
highestTimestampMetric: prometheus.NewGauge(prometheus.GaugeOpts{
|
highestTimestampMetric: prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Name: "prometheus_remote_storage_highest_timestamp_in",
|
Name: "prometheus_remote_storage_highest_timestamp_in",
|
||||||
Help: "Highest timestamp that has come into the remote storage via the Appender interface.",
|
Help: "Highest timestamp that has come into the remote storage via the Appender interface, in seconds since epoch.",
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
reg.MustRegister(s.samplesInMetric)
|
reg.MustRegister(s.samplesInMetric)
|
||||||
|
|
|
@ -55,7 +55,7 @@ func (t *timestampTracker) Commit() error {
|
||||||
defer t.storage.highestTimestampMtx.Unlock()
|
defer t.storage.highestTimestampMtx.Unlock()
|
||||||
if t.highestTimestamp > t.storage.highestTimestamp {
|
if t.highestTimestamp > t.storage.highestTimestamp {
|
||||||
t.storage.highestTimestamp = t.highestTimestamp
|
t.storage.highestTimestamp = t.highestTimestamp
|
||||||
t.storage.highestTimestampMetric.Set(float64(t.highestTimestamp))
|
t.storage.highestTimestampMetric.Set(float64(t.highestTimestamp) / 1000.)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue