honor_timestamps

521 views
Skip to first unread message

John Yost

unread,
Sep 20, 2021, 1:53:55 PM9/20/21
to Prometheus Users
Does anyone have an example of honor_timestamps=true in particular, how to specify the timestamp field?

Bjoern Rabenstein

unread,
Sep 28, 2021, 1:53:15 PM9/28/21
to John Yost, Prometheus Users
On 20.09.21 10:53, John Yost wrote:
> Does anyone have an example of honor_timestamps=true in particular, how to
> specify the timestamp field?

See https://prometheus.io/docs/instrumenting/exposition_formats/ for
the spec of the exposition format, which also include timestamps.

Instrumentation libraries might or might not support adding
timestamps. Example for the Go library:
https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#NewMetricWithTimestamp

Note, however, that adding timestamps is an extremely niche use
case. Most of the users who think the need it should actually not do
it.

The main usecases within that tiny niche are federation and mirroring
the data from another monitoring system.

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in

PK

unread,
Oct 9, 2021, 11:57:58 PM10/9/21
to Prometheus Users
In Golang:  NewMetricWithTimestamp(t time.Time, m Metric) is the function used to expose metric value along with timestamps.
Reply all
Reply to author
Forward
0 new messages