Brian Candler wrote: > > > Isn't "(foo == N)[2d:]" what I'm looking for? I don't quite grok > > subqueries, but the resolution parameter seems to be optional. At > > least "(foo == N)[2d:]" seems to show the timestamps I was looking > > for. > > > > As it says here > <https://prometheus.io/docs/prometheus/latest/querying/basics/#subquery>: > "<resolution> is optional. Default is the global evaluation interval." > > So if your global evaluation interval is 1m, then that expression is the > same as (foo == N)[2d:1m]
Hello Brian! I don't quite understand why "(foo == N)[2d:1m]" or even "(foo == N)[2d:]" is allowed while "(foo == N)[2d]" is not? > > What this does is evaluate the expression foo == N at the current time T, > at time T-1m, at time T-2m etc. In the results, this won't give you the > *exact* time that the data point occurred: it will give you a timestamp of > T-Nm, which will be up to 1 minute after the timestamp of the point > itself. (The value of a timeseries at time T is the value of the most > recent data point on or before time T). Sounds fine with me if it does not skip/hide peaks but shows the time nearest to the peak. Does it? > > Also, individual scrape jobs can use different scrape intervals. If you > have a global eval interval of 1 minute but this particular scrape job uses > 15s, then the above expression will return (on average) 1 in every 4 data > points. I have 15s across all my prometheus instances as I've read somewhere that it is the best practice to have a unified scrape interval everywhere. -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/YdQAK9k7SqXjimiz%40admin.sibptus.ru.

