<p>I am trying to add custom alert-routing config to my alertmanager, deployed as a part of kube-prometheus-stack. But prometheus-operator pod, while trying to generate the alertmanager configmap, fails due to the following error:</p>
<pre><code>level=error ts=2021-05-31T06:29:38.883470881Z caller=klog.go:96 component=k8s_client_runtime func=ErrorDepth msg=&quot;Sync \&quot;infra-services/prometheus-operator-kube-p-alertmanager\&quot; failed: provision alertmanager configuration: base config from Secret could not be parsed: yaml: unmarshal errors:\n line 19: field matchers not found in type config.plain&quot;
</code></pre>
<p>I also validated the same using amtool inside alertmanager container, which gives the same error. Here is my alertmanager.yml file:</p>
<pre><code>global:
  resolve_timeout: 5m
  slack_api_url: https://hooks.slack.com/services/xxxxxx/yyyyy/zzzzzzzzzzz
receivers:
- name: slack-notifications
  slack_configs:
  - channel: '#alerts'
    send_resolved: true
    text: '{{ template &quot;slack.myorg.text&quot; . }}'
- name: blackhole-receiver
route:
  group_by:
  - alertname
  group_interval: 5m
  group_wait: 30s
  receiver: blackhole-receiver
  repeat_interval: 12h
  routes:
  - matchers:
    - severity=~&quot;warning|critical&quot;
    receiver: slack-notifications
templates:
- /etc/alertmanager/config/*.tmpl
</code></pre>
<p>I have followed <a href="https://prometheus.io/docs/alerting/latest/configuration/" rel="noreferrer">https://prometheus.io/docs/alerting/latest/configuration/</a> and <a href="https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml" rel="noreferrer">https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml</a> to write my simple alertmanager config.</p>

<p>Try to change from:</p>
<pre><code>  routes:
  - matchers:
    - severity=~&quot;warning|critical&quot;
    receiver: slack-notifications
</code></pre>
<p>To:</p>
<pre><code>  routes:
    - match_re:
        severity: &quot;warning|critical&quot;
      receiver: slack-notifications
</code></pre>
