use*_*702 3 kubernetes prometheus
为什么我在路由中使用的接收器为空?注释掉与 相关的路由null仍然会产生相同的错误。
知道如何解决这个问题吗?配置看起来正确吗?它昨天确实有效,但我删除了所有内容并尝试重新安装,但出现此错误。
failed: provision alertmanager configuration: base config from Secret could not be parsed: undefined receiver \"null\" used in route
另外,如何为每个警报提供单独的电子邮件?当它工作时,它通常会发送一个摸索警报。我可以禁用路线部分并只有接收器吗?会单独发送警报吗?group_by: ['...']还是分组发送..
config:
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 30s
group_interval: 5m
repeat_interval: 30m
receiver: 'null'
routes:
- match:
alertname: Watchdog
receiver: 'null'
receivers:
- name: 'null'
route:
group_by: ['...']
receiver: 'email-alert'
receivers:
- name: 'email-alert'
email_configs:
- to: test@gmail.com
from: test@gmail.com
smarthost: postfix.test-internal:25
require_tls: false
Run Code Online (Sandbox Code Playgroud)
这是日志条目:
level=info ts=2020-12-21T03:17:54.675369726Z caller=operator.go:1163 component=prometheusoperator msg="sync prometheus" key=monitoring/prometheus-kube-prometheus-prometheus
level=error ts=2020-12-21T03:17:54.678077463Z caller=klog.go:96 component=k8s_client_runtime func=ErrorDepth msg="Sync \"monitoring/prometheus-kube-prometheus-alertmanager\" failed: provision alertmanager configuration: base config from Secret could not be parsed: undefined receiver \"null\" used in route"
level=info ts=2020-12-21T03:17:57.297131904Z caller=operator.go:661 component=alertmanageroperator msg="sync alertmanager" key=monitoring/prometheus-kube-prometheus-alertmanager
level=info ts=2020-12-21T03:17:57.29721675Z caller=operator.go:1163 component=prometheusoperator msg="sync prometheus" key=monitoring/prometheus-kube-prometheus-prometheus
level=error ts=2020-12-21T03:17:57.301610335Z caller=klog.go:96 component=k8s_client_runtime func=ErrorDepth msg="Sync \"monitoring/prometheus-kube-prometheus-alertmanager\" failed: provision alertmanager configuration: base config from Secret could not be parsed: undefined receiver \"null\" used in route"
level=info ts=2020-12-21T03:17:59.906899712Z caller=operator.go:1163 component=prometheusoperator msg="sync prometheus" key=monitoring/prometheus-kube-prometheus-prometheus
level=info ts=2020-12-21T03:17:59.909936845Z caller=operator.go:661 component=alertmanageroperator msg="sync alertmanager" key=monitoring/prometheus-kube-prometheus-alertmanager
level=error ts=2020-12-21T03:17:59.915494013Z caller=klog.go:96 component=k8s_client_runtime func=ErrorDepth msg="Sync \"monitoring/prometheus-kube-prometheus-alertmanager\" failed: provision alertmanager configuration: base config from Secret could not be parsed: undefined receiver \"null\" used in route"
Run Code Online (Sandbox Code Playgroud)
在 YAML 中,null和"null"不是同一件事。
null: 代表NULL值"null": 表示等于 的字符串"null"。尝试删除引用:
routes:
- match:
alertname: Watchdog
receiver: null
receivers:
- name: null
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5915 次 |
| 最近记录: |