Merge pull request #3635 from hoffie/README-config-new-matchers

README: Use new matchers syntax in config examples
This commit is contained in:
Simon Pasquier 2023-12-11 10:41:43 +01:00 committed by GitHub
commit a7252c7927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,45 +102,45 @@ route:
# The child route trees.
routes:
# This routes performs a regular expression match on alert labels to
# This route performs a regular expression match on alert labels to
# catch alerts that are related to a list of services.
- match_re:
service: ^(foo1|foo2|baz)$
- matchers:
- service=~"^(foo1|foo2|baz)$"
receiver: team-X-mails
# The service has a sub-route for critical alerts, any alerts
# that do not match, i.e. severity != critical, fall-back to the
# parent node and are sent to 'team-X-mails'
routes:
- match:
severity: critical
- matchers:
- severity="critical"
receiver: team-X-pager
- match:
service: files
- matchers:
- service="files"
receiver: team-Y-mails
routes:
- match:
severity: critical
- matchers:
- severity="critical"
receiver: team-Y-pager
# This route handles all alerts coming from a database service. If there's
# no team to handle it, it defaults to the DB team.
- match:
service: database
- matchers:
- service="database"
receiver: team-DB-pager
# Also group alerts by affected database.
group_by: [alertname, cluster, database]
routes:
- match:
owner: team-X
- matchers:
- owner="team-X"
receiver: team-X-pager
- match:
owner: team-Y
- matchers:
- owner="team-Y"
receiver: team-Y-pager