Sorry, I don't know what you mean by
parameter -service=<alertname> or
parameter -service="team: oncall"
I still don't know where you're getting "service" from here. There are only labels, which are name/value pairs. Each alert can carry one or more labels. e.g.
alertname="foo" # label "alertname" with value "foo"
team="oncall" # label "team" with value "oncall"
service="web" # label "service" with value "web"
Something like "service=team=oncall" doesn't make any sense.
As for the dash, I think you may be confused by YAML syntax. A dash starts a member of a list. For example:
colours:
- red
- green
- blue
which can also be written in YAML as
colours: [red, green, blue]
and is equivalent to the following JSON:
{"colors": ["red", "green", "blue"]}
If a list contains objects, then the start of each object is marked by a dash. e.g.
shirts:
- colour: red
size: small
- colour: red
size: medium
- colour: green
size: medium
(Note how important getting the alignment right is!)
This equates to JSON:
{"shirts": [
{"color":"red", "size":"small"},
{"color":"red", "size":"medium"},
{"color":"green", "size":"medium"}
]}
(which doesn't care about alignment because there are explicit opening and closing braces and brackets)
Your alerting rules are similar to this: each rule starts with a dash, and then there are one or more settings below it. Formatting your original example properly:
- receiver: 'database-pager'
group_wait: 10s
matchers:
- service=~"mysql|cassandra"
This is a single rule within a list of rules (the first "-" marks this as a list element)
This rule has three settings: receiver, group_wait, and matchers.
matchers is itself a list.
There is one element in this list (also marked by a dash)
The content of that element is a string:
service=~"mysql|cassandra"
Each element under "matchers" is a PromQL matching rule. In this case, it matches the label "service" against that regular expression, which matches either the value "mysql" or "cassandra".
Therefore: that rule matches alerts which have a label "service" with value "mysql" or "cassandra". If the rule matches, then the alert is delivered to "database-pager" with group_wait of 10 seconds. If the alert doesn't match, then it moves onto the next rule. And if none of the rules match, it falls back to the default receiver selected elsewhere in the config.
It looks like I'm not expressing myself clearly, so perhaps someone else might be able to explain it more clearly than me.