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

ruler: fix TestRulerMetricsForInvalidQueriesAndNoFetchedSeries #6843

Conversation

dimitarvdimitrov
Copy link
Contributor

instead of assuming that rules only evaluate once, use the increase in the counter to tell whether the query is with 0 series or not

In addition to that add another helper function for comparing cortex_prometheus_last_evaluation_samples

instead of assuming that rules only evaluate once, use the increase in the counter to tell whether the query is with 0 series or not

In addition to that add another helper function for comparing cortex_prometheus_last_evaluation_samples

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
@dimitarvdimitrov dimitarvdimitrov requested a review from a team as a code owner December 6, 2023 16:59
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Copy link
Contributor

@zenador zenador left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for this! Only have nits for formatting consistency.

integration/ruler_test.go Outdated Show resolved Hide resolved
integration/ruler_test.go Outdated Show resolved Hide resolved
integration/ruler_test.go Outdated Show resolved Hide resolved
integration/ruler_test.go Show resolved Hide resolved
integration/ruler_test.go Show resolved Hide resolved
dimitarvdimitrov and others added 5 commits December 6, 2023 20:50
Co-authored-by: zenador <zenador@users.noreply.github.com>
Co-authored-by: zenador <zenador@users.noreply.github.com>
Co-authored-by: zenador <zenador@users.noreply.github.com>
Co-authored-by: zenador <zenador@users.noreply.github.com>
Co-authored-by: zenador <zenador@users.noreply.github.com>
@dimitarvdimitrov dimitarvdimitrov enabled auto-merge (squash) December 7, 2023 09:40
@dimitarvdimitrov dimitarvdimitrov merged commit 73ff5a2 into main Dec 7, 2023
82 of 84 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the dimitar/ruler/fix-TestRulerMetricsForInvalidQueriesAndNoFetchedSeries branch December 7, 2023 11:11
grafanabot pushed a commit that referenced this pull request Dec 8, 2023
* ruler: fix TestRulerMetricsForInvalidQueriesAndNoFetchedSeries

instead of assuming that rules only evaluate once, use the increase in the counter to tell whether the query is with 0 series or not

In addition to that add another helper function for comparing cortex_prometheus_last_evaluation_samples

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Fix assertion

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Update ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update integration/ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update integration/ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

---------

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Co-authored-by: zenador <zenador@users.noreply.github.com>
(cherry picked from commit 73ff5a2)
krajorama pushed a commit that referenced this pull request Dec 8, 2023
#6854)

* ruler: fix TestRulerMetricsForInvalidQueriesAndNoFetchedSeries

instead of assuming that rules only evaluate once, use the increase in the counter to tell whether the query is with 0 series or not

In addition to that add another helper function for comparing cortex_prometheus_last_evaluation_samples

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Fix assertion

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Update ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update integration/ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

* Update integration/ruler_test.go

Co-authored-by: zenador <zenador@users.noreply.github.com>

---------

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Co-authored-by: zenador <zenador@users.noreply.github.com>
(cherry picked from commit 73ff5a2)

Co-authored-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants