diff --git a/docs/sources/alerting/fundamentals/annotation-label/labels-and-label-matchers.md b/docs/sources/alerting/fundamentals/annotation-label/labels-and-label-matchers.md index 53f79c4ac61..4376537d0b0 100644 --- a/docs/sources/alerting/fundamentals/annotation-label/labels-and-label-matchers.md +++ b/docs/sources/alerting/fundamentals/annotation-label/labels-and-label-matchers.md @@ -30,15 +30,18 @@ A label matchers consists of 3 distinct parts, the **label**, the **value** and | `=~` | Select labels that regex-match the value. | | `!~` | Select labels that do not regex-match the value. | -## Example of a label matcher +If you are using multiple label matchers, they are combined using the AND logical operator. This means that all matchers must match in order to link a rule to a policy. -Imagine we've defined the following set of labels for our alert. +## Example scenario + +If you define the following set of labels for your alert: `{ foo=bar, baz=qux, id=12 }` -In this situation, +then: -- A label matcher defined as `foo=bar` will match this alert rule. -- A label matcher defined as `foo!=bar` will _not_ match this alert rule. -- A label matcher defined as `id=~[0-9]+` will match this alert rule. -- A label matcher defined as `baz!~[0-9]+` will match this alert rule. +- A label matcher defined as `foo=bar` matches this alert rule. +- A label matcher defined as `foo!=bar` does _not_ match this alert rule. +- A label matcher defined as `id=~[0-9]+` matches this alert rule. +- A label matcher defined as `baz!~[0-9]+` matches this alert rule. +- Two label matchers defined as `foo=bar` and `id=~[0-9]+` match this alert rule.