prometheus/docs/configuration
Gabriel Filion 9f0b52d73a docs: Describe how time() is set to start at 0 in unit tests
The return value of functions relating to the current time, e.g. time(),
is set by promtool to start at timestamp 0 at the start of a test's
evaluation.

This has the very nice consequence that tests can run reliably without
depending on when they are run.

It does, however, mean that tests will give out results that can be
unexpected by users.

If this behaviour is documented, then users will be empowered to write
tests for their rules that use time-dependent functions.

(Closes: prometheus/docs#1464)

Signed-off-by: Gabriel Filion <lelutin@torproject.org>
2025-12-02 16:57:01 +01:00
..
2025-05-28 21:37:27 +02:00