Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promql: return NaN from irate() if second-last sample is NaN #16199

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Mar 12, 2025

This PR fixes a regression introduced in #15853 that causes irate() to return a non-NaN value if the second-last point is a NaN but the last point is not.

In this case, then irate() would ignore the NaN and compute the rate as if a counter reset occurred before the last point.

charleskorn added a commit to grafana/mimir that referenced this pull request Mar 12, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 12, 2025
@charleskorn charleskorn changed the title promql: return NaN from irate() if either of last two samples is NaN promql: return NaN from irate() if second-last sample is NaN Mar 12, 2025
@charleskorn
Copy link
Contributor Author

CI linting failure seems completely unrelated to this change.

@charleskorn charleskorn marked this pull request as ready for review March 12, 2025 00:31
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 12, 2025
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 12, 2025
* Upgrade mimir-prometheus

* Bring in upstream test changes

* Apply change to match prometheus/prometheus#15974

* Remove test case added in upstream in prometheus/prometheus#15975

* Add tests for case where range vector selectors and subqueries have 0 range

Brings in change from #10586

* Update `sort` and `sort_desc` behaviour to match prometheus/prometheus#15964

* Add support for native histograms to `irate` and `idelta` to match prometheus/prometheus#15853

* Adjust test cases to match support for native histograms in `irate` and `idelta`

* Change binop annotations to match behaviour in prometheus/prometheus#15895

* Ignore incompatible schemas between the first and second point in `rate` and `increase` if the second point is a reset (prometheus/prometheus#15902)

* Adjust annotation test cases to match new behaviour introduced in previous commit

* Disable tests failing due to prometheus/prometheus#16199

* Add changelog entry

* Update `TestQuerySharding_FunctionCorrectness` to reflect changes in prometheus/prometheus#15964
@bwplotka
Copy link
Member

CI linting failure seems completely unrelated to this change.

Yes, see the ongoing issue #16203

Signed-off-by: Charles Korn <[email protected]>
@beorn7 beorn7 merged commit c88d0b0 into prometheus:main Mar 13, 2025
27 checks passed
charleskorn added a commit to grafana/mimir that referenced this pull request Mar 21, 2025
zenador pushed a commit to grafana/mimir that referenced this pull request Mar 21, 2025
* Upgrade mimir-prometheus

* Adjust tests to match new pretty printing format in prometheus/prometheus#16083

* Fix breaking change from prometheus/prometheus#16156

* Upgrade to github.com/oklog/ulid/v2 (prometheus/prometheus#16168)

* Bring in changes from prometheus/prometheus#16199

* Remove OOO native histograms flag (prometheus/prometheus#16207)

* Add changelog entries

* Ignore deprecation warning for `model.NameValidationScheme`

* Remove outdated native histogram OOO integration test
machine424 pushed a commit to machine424/prometheus that referenced this pull request Mar 26, 2025
…theus#16199)

promql: return NaN from `irate()` if either of last two samples is NaN

Signed-off-by: Charles Korn <[email protected]>

---------

Signed-off-by: Charles Korn <[email protected]>
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.

3 participants