Skip to content

Commit

Permalink
Mixins(Rule): Fix query for long rule evaluations (thanos-io#6103)
Browse files Browse the repository at this point in the history
* mixin(Rule): Fix query for long rule evaluations

Signed-off-by: Douglas Camata <[email protected]>

* Update changelog

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
  • Loading branch information
douglascamata authored Feb 8, 2023
1 parent 4bb560e commit 1839858
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#6050](https://github.com/thanos-io/thanos/pull/6050) Store: Re-try bucket store initial sync upon failure.
- [#6067](https://github.com/thanos-io/thanos/pull/6067) Receive: fixed panic when querying uninitialized TSDBs.
- [#6082](https://github.com/thanos-io/thanos/pull/6082) Store: Don't error when no stores are matched.
- [#6103](https://github.com/thanos-io/thanos/pull/6103) Mixins(Rule): Fix query for long rule evaluations.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion examples/dashboards/rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"steppedLine": false,
"targets": [
{
"expr": "(\n max by(job, rule_group) (prometheus_rule_group_last_duration_seconds{job=~\"$job\"})\n >\n sum by(job, rule_group) (prometheus_rule_group_interval_seconds{job=~\"$job\"})\n)\n",
"expr": "(\n sum by(job, rule_group) (prometheus_rule_group_last_duration_seconds{job=~\"$job\"})\n >\n sum by(job, rule_group) (prometheus_rule_group_interval_seconds{job=~\"$job\"})\n)\n",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{ rule_group }}",
Expand Down
2 changes: 1 addition & 1 deletion mixin/dashboards/rule.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ local utils = import '../lib/utils.libsonnet';
g.queryPanel(
|||
(
max by(%(dimensions)s, rule_group) (prometheus_rule_group_last_duration_seconds{%(selector)s})
sum by(%(dimensions)s, rule_group) (prometheus_rule_group_last_duration_seconds{%(selector)s})
>
sum by(%(dimensions)s, rule_group) (prometheus_rule_group_interval_seconds{%(selector)s})
)
Expand Down

0 comments on commit 1839858

Please sign in to comment.