Tap*_*ani 6 kubernetes prometheus prometheus-alertmanager
我正在尝试将自定义警报路由配置添加到我的警报管理器中,作为 kube-prometheus-stack 的一部分部署。但是 prometheus-operator pod 在尝试生成alertmanager configmap 时,由于以下错误而失败:
level=error ts=2021-05-31T06:29:38.883470881Z caller=klog.go:96 component=k8s_client_runtime func=ErrorDepth msg="Sync \"infra-services/prometheus-operator-kube-p-alertmanager\" 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"
Run Code Online (Sandbox Code Playgroud)
我还在alertmanager容器内使用amtool验证了相同的内容,这给出了相同的错误。这是我的alertmanager.yml 文件:
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 "slack.myorg.text" . }}'
- name: blackhole-receiver
route:
group_by:
- alertname
group_interval: 5m
group_wait: 30s
receiver: blackhole-receiver
repeat_interval: 12h
routes:
- matchers:
- severity=~"warning|critical"
receiver: slack-notifications
templates:
- /etc/alertmanager/config/*.tmpl
Run Code Online (Sandbox Code Playgroud)
我按照https://prometheus.io/docs/alerting/latest/configuration/和https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml编写了简单的alertmanager配置。
Mar*_*ira 10
尝试改变:
routes:
- matchers:
- severity=~"warning|critical"
receiver: slack-notifications
Run Code Online (Sandbox Code Playgroud)
到:
routes:
- match_re:
severity: "warning|critical"
receiver: slack-notifications
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15086 次 |
| 最近记录: |