【问题标题】:Debug alertmanager webhook调试 alertmanager webhook
【发布时间】:2021-01-11 17:40:10
【问题描述】:

我使用的是 rancher 2.5 提供的监控应用程序,它实际上是在安装 kube-prometheus-stack Helm 图表。我正在尝试使用 webhook 作为接收器发送警报。 webhook 位于自定义服务上,该服务记录了它使用 http 400 响应请求。我的问题是如何查看发送到提供 webhook 的服务器的请求警报管理器。我正在使用log.level=debug 运行 pod,但我看到的唯一日志是:

level=debug ts=2021-01-11T17:22:32.629Z caller=notify.go:685 component=dispatcher receiver=prometheus integration=webhook[0] msg="Notify success" attempts=1
level=debug ts=2021-01-11T17:23:02.591Z caller=dispatch.go:138 component=dispatcher msg="Received alert" alert=Watchdog[7109567][active]
level=debug ts=2021-01-11T17:23:32.594Z caller=dispatch.go:473 component=dispatcher aggrGroup="{}/{severity=~\"^(?:warning|none|critical)$\"}:{}" msg=flushing alerts=[Watchdog[7109567][active]] 

这没什么用,我想看看实际的请求和响应。

【问题讨论】:

    标签: kubernetes prometheus webhooks prometheus-alertmanager prometheus-operator


    【解决方案1】:

    所以我设法解决这个问题的方法是将 webhook 发送到实际上可以运行 netcat -l 的中间服务器,然后我将请求复制到实际目的地。

    k8s 唯一的替代方案是运行:https://github.com/eldadru/ksniff

    遗憾的是我没有找到更好的解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-11
      • 2020-08-07
      • 2021-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多