Changes
Page history
alerts: document how time() works in unit tests
authored
Aug 20, 2025
by
anarcat
Show whitespace changes
Inline
Side-by-side
service/prometheus.md
View page @
1fdca460
...
...
@@ -1423,6 +1423,15 @@ tests:
# need to test?). You can play with the eval_time in other test
# entries to evaluate the same alert at different offsets in the
# timeseries above.
#
# Note that the `time()` function returns zero when the evaluation
# starts, and increments by `interval` until `eval_time` is
# reached, which differs from how things work in reality,
# where time() is the number of seconds since the
# epoch.
#
# in other words, this means the simulation starts at the
# Epoch and stops (here) an hour later.
-
eval_time
:
60m
alertname
:
NeedsReboot
exp_alerts
:
...
...
...
...