mirror of
https://github.com/prometheus/prometheus.git
synced 2026-03-31 19:31:13 +02:00
When last_over_time or first_over_time is applied to a subquery that
contains functions like abs(), round(), etc., the DropName flag should
be preserved. Previously, the flag was unconditionally overwritten based
solely on the function name, ignoring the input series state.
This fix checks if the input series (from a subquery) already has
DropName=true and respects that flag by using OR logic.
Before this fix:
last_over_time(abs(metric)[10m:]) incorrectly returned {__name__="metric", ...}
After this fix:
last_over_time(abs(metric)[10m:]) correctly returns {...} without __name__
The same behavior applies to first_over_time().
Fixes #18397
---------
Signed-off-by: Vamsi Mathala <vmathala@redhat.com>