Time functions
Prometheus supplies a number of functions to help manipulating time data. These are useful for a couple of scenarios, such as checking how long ago was a process or batch job last seen, only triggering alerts at certain times, or not triggering them at all on certain days. Every time function in Prometheus assumes Universal Coordinated Time (UTC).
The time function returns an instant vector with the current time in the UNIX epoch format (commonly known as a UNIX timestamp): the number of seconds that have elapsed since January 1st, 1970 UTC.
The timestamp function returns an instant vector with the UNIX timestamps of the samples returned by the supplied selector.
The minute, hour, month and year functions all work the same ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access