thanos
thanos copied to clipboard
query: different results for rate function when not dedup or using implicit step interval
Thanos, Prometheus and Golang version used: thanos query 0.35.0 thanos sidecar 0.35.0 prometheus 2.45.0
What happened: when calculating rate for a metric, there are cases where the result if different when dedup is enabled/disabled. In addition there is the same difference if using a step [5m:1m] and not using [5m] although the default step is the same.
What you expected to happen: I expect the rate result to be the same (or much closer)
How to reproduce it (as minimally and precisely as possible):
My environment has 2 prometheus servers which are replicas of each other (scraping the same targets)
sidecars external labels: fqdn=
I start thanos with those 2 servers as stores, replica-label=fqdn
then when querying in thanos the rate query in a specific time:
rate(my_metric{_label_0="service",_label_1="requests",_label_2="timer", server="server00102"}[5m])
using dedup and without dedup, the results are completely different
the results are also different if querying with step (same results as without dedup)
rate(my_metric{_label_0="service",_label_1="requests",_label_2="timer", server="server00102"}[5m:1m])