Scorecard rule filters
Similar to rule exemptions, rule filters allow you to apply a Scorecard rule only to specific services. While individual users have to request exemptions when an entity is failing, rule filters are implemented when creating or editing a Scorecard. This will come in handy when a rule doesn’t apply to every entity or every group.
You can apply a filter in the Cortex UI while building out your Scorecard rules, or you can write a custom CQL query to filter your rule.
How to set up a Scorecard rule filter
- When setting up a rule for a Scorecard, click and expand Restrict rule to specific groups.
- Select the relevant groups to include or exclude.
- Or, if you prefer to write a CQL query, click Switch to CQL under the group fields.
- Or, if you prefer to write a CQL query, click Switch to CQL under the group fields.
- Click Save rule.
See the Scorecard documentation for instructions on the overall process of creating a Scorecard.
Example Scorecard rule filter
For example, say that our Cookiecutter repos don’t need to have SLOs set up properly, we can filter out the "Has SLOs set up" rule by applying a filter for the group “cookiecutter.”
When you return to the Scorecard rules with a filter applied, you’ll see that the rule is not included in the passing or failing list of rules for the relevant entities because it isn’t being evaluated:
View the filter on the Scorecard home page
Once a rule filter has been applied, you can still see it on a Scorecard’s home page. Navigate to the Rules tab and expand the rule to confirm it has been exempted.
In the example below, you can see that services in cookiecutter are exempt from the "Has SLOs set up" rule: