Skip to content

Conversation

@fpetkovski
Copy link
Collaborator

The refactor in #477 introduces a bug where subquery on top of avg produces wrong results.

This is because the parents are calculated before the query is rewritten, so the new nodes end up with no parents.

The refactor in thanos-io#477 introduces
a bug where subquery on top of avg produces wrong results.

This is because the parents are calculated before the query is rewritten,
so the new nodes end up with no parents.

Signed-off-by: Filip Petkovski <[email protected]>
{name: "absent for existing metric", query: `absent(bar{pod="nginx-1"})`},
{name: "absent for existing metric with aggregation", query: `sum(absent(bar{pod="nginx-1"}))`},
{name: "subquery with sum/count", query: `max_over_time((sum(bar)/count(bar))[30s:15s])`},
{name: "subquery with avg", query: `max_over_time(avg(bar)[30s:15s])`},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails on main.

Signed-off-by: Filip Petkovski <[email protected]>
@MichaHoffmann MichaHoffmann merged commit 2f49f80 into thanos-io:main Dec 3, 2024
7 checks passed
subhramit pushed a commit to subhramit/promql-engine that referenced this pull request Feb 12, 2025
* Fix subquery over avg

The refactor in thanos-io#477 introduces
a bug where subquery on top of avg produces wrong results.

This is because the parents are calculated before the query is rewritten,
so the new nodes end up with no parents.

Signed-off-by: Filip Petkovski <[email protected]>

* Fix lint

Signed-off-by: Filip Petkovski <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: subhramit <[email protected]>
fpetkovski added a commit to fpetkovski/thanos that referenced this pull request Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants