gpt4 book ai didi

kubernetes - Prometheus - 路由中使用的未定义接收器\"null\"

转载 作者:行者123 更新时间:2023-12-05 03:46:15 24 4
gpt4 key购买 nike

为什么我在路由中使用了 receiver null?注释掉与 null 相关的路由仍然会产生相同的错误。

知道如何解决这个问题吗?配置看起来正确吗?它昨天确实有效,但我删除了所有内容并尝试重新安装,但我收到此错误。

失败:提供 alertmanager 配置:无法解析来自 Secret 的基本配置:路由中使用了未定义的接收器\"null\"

另外,如何为每个警报设置单独的电子邮件?当它工作时,它通常会发送一个摸索警报。我可以只禁用路线部分并且只有接收器吗?那会单独发送警报吗? 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

这是日志条目:

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"

最佳答案

在 YAML 中,null"null" 不是一回事。

  • null:代表NULL值
  • "null":表示等于"null"的字符串。

尝试删除引号:

      routes:
- match:
alertname: Watchdog
receiver: null
receivers:
- name: null

关于kubernetes - Prometheus - 路由中使用的未定义接收器\"null\",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65387198/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com