-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 the /api/v1/rules endpoint #1773
Conversation
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2d195e6
to
cd6271c
Compare
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
e57bf1d
to
cbfac08
Compare
/cc @bwplotka |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, otherwise LGTM (:
pkg/rule/api/v1_test.go
Outdated
expr1, err := promql.ParseExpr(`absent(test_metric3) != 1`) | ||
if err != nil { | ||
m.testing.Fatalf("unable to parse alert expression: %s", err) | ||
panic(fmt.Sprintf("unable to parse alert expression: %s", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why panicking in tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it should never fail but I can revert if you prefer.
CHANGELOG.md
Outdated
@@ -27,6 +27,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel | |||
- [#1669](https://github.com/thanos-io/thanos/pull/1669) Fixed store sharding. Now it does not load excluded meta.jsons and load/fetch index-cache.json files. | |||
- [#1670](https://github.com/thanos-io/thanos/pull/1670) Fixed un-ordered blocks upload. Sidecar now uploads the oldest blocks first. | |||
- [#1568](https://github.com/thanos-io/thanos/pull/1709) Thanos Store now retains the first raw value of a chunk during downsampling to avoid losing some counter resets that occur on an aggregation boundary. | |||
- [#1773](https://github.com/thanos-io/thanos/pull/1773) Thanos Ruler: fixed the /api/v1/rules endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we tell users what exactly problem was fixed?
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
thanks @bwplotka for the review and @simonpasquier for the contribution! 🎉 |
* test/e2e: test alerts and rules API endpoints Signed-off-by: Simon Pasquier <spasquie@redhat.com> * pkg/rule: fix /api/v1/rules endpoint Signed-off-by: Simon Pasquier <spasquie@redhat.com> * Address Bartek's comments Signed-off-by: Simon Pasquier <spasquie@redhat.com> Signed-off-by: Aleksey Sin <asin@ozon.ru>
Closes #1189
Changes
Fixed the switch type in the
rules
handler because alerting rules are instances of*rules.AlertingRule
, notthanosrule.AlertingRule
. This is because the rules are returned from the Prometheus rule managers and have no notion ofPartialResponseStrategy
.Verification
The
/api/v1/rules
and/api/v1/alerts
endpoints are now covered by the end-to-end tests.