cortex icon indicating copy to clipboard operation
cortex copied to clipboard

Add filtering by health and state in list rules

Open euniceek opened this issue 1 year ago • 1 comments

What this PR does:

This PR adds two additional filtering fields to the list rules API. If users want to list rules that are in firing state or healthy, they will be able to do it using the following parameters.

  • api/v1/ruleinfos?state=firing
  • api/v1/ruleinfos?health=ok

Checklist

  • [X] Tests updated
  • [ ] Documentation added
  • [ ] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

euniceek avatar Jun 26 '24 00:06 euniceek

@euniceek Can you please update the PR description? I don't think Cortex supports ruleinfo API

yeya24 avatar Jun 28 '24 23:06 yeya24

@euniceek Can you please update the PR description? I don't think Cortex supports ruleinfo API

Thanks for the review! Updated!

euniceek avatar Jul 02 '24 15:07 euniceek

Let's wait for another approval from a maintainer before merging this.

yeya24 avatar Jul 02 '24 17:07 yeya24

@euniceek Can you also update the changelog? We can call it an enhancement

yeya24 avatar Jul 02 '24 17:07 yeya24

ok.. LGTM!

alanprot avatar Jul 09 '24 20:07 alanprot