Grafana Telegram 警报问题无法发送警报通知

发布于 2025-01-09 17:31:26 字数 3536 浏览 1 评论 0原文

我正在尝试在 Grafana 上设置电报通知,但收到此错误

在此处输入图像描述

测试无法发送通知。 这是我的 docker-compose.yml 文件

version: "3.7"

services:
  loki:
    image: grafana/loki:1.4.1
    ports:
      - "3100:3100"
    command: -config.file=/etc/loki/local-config.yaml

  promtail:
    image: grafana/promtail:1.4.1
    volumes:
      - /var/lib/docker/containers:/var/lib/docker/containers
      - /var/www/nt_devops/monitoring/docker-config.yml:/etc/promtail/docker-config.yml
    command: -config.file=/etc/promtail/docker-config.yml

  grafana:
    image: grafana/grafana:master
    ports:
      - "9095:3000"
    volumes:
      - grafana_data:/var/lib/grafana
      - grafana:/etc/grafana
   

volumes:
  grafana_data:
  grafana:

这是我的 grafana 容器日志

2-23T05:11:55+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=10.0.0.2 time_ms=35 size=48 referer=https://grafana.example.com/alerting/notification/1/edit
t=2022-02-23T05:11:58+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=0 remote_addr=10.0.0.2 time_ms=1 size=0 referer=
t=2022-02-23T05:12:00+0000 lvl=info msg="Sending telegram notification" logger=alerting.notifier.telegram chat_id=-654204299 bot_token=5145999542:AAH16mk4Vh__sHh9JMnhdoNtELbRuuflbI4 apiAction=sendMessage
t=2022-02-23T05:12:00+0000 lvl=eror msg="Failed to send webhook" logger=alerting.notifier.telegram error="Webhook response status 400 Bad Request" webhook=grafana_telegram
t=2022-02-23T05:12:00+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:12:00+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:12:00+0000 lvl=eror msg="Failed to send alert notifications" logger=context userId=1 orgId=1 uname=admin error="Webhook response status 400 Bad Request" remote_addr=10.0.0.2

2-23T05:12:00+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=10.0.0.2 time_ms=34 size=48 referer=https://grafana.example.com/alerting/notification/1/edit
t=2022-02-23T05:16:36+0000 lvl=info msg="Sending telegram notification" logger=alerting.notifier.telegram chat_id=-654204299 bot_token=5145999542:AAH16mk4Vh__sHh9JMnhdoNtELbRuuflbI4 apiAction=sendMessage
t=2022-02-23T05:16:36+0000 lvl=eror msg="Failed to send webhook" logger=alerting.notifier.telegram error="Webhook response status 400 Bad Request" webhook=grafana_telegram
t=2022-02-23T05:16:36+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:16:36+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:16:36+0000 lvl=eror msg="Failed to send alert notifications" logger=context userId=1 orgId=1 uname=admin error="Webhook response status 400 Bad Request" remote_addr=10.0.0.2

我正在使用主机网络,没有任何其他网络。我认为这是网络问题

这是浏览器控制台错误

在此处输入图像描述

I am trying to setup telegram notification on Grafana but I am getting this error

enter image description here

Test fails to send notification.
Here is my docker-compose.yml file

version: "3.7"

services:
  loki:
    image: grafana/loki:1.4.1
    ports:
      - "3100:3100"
    command: -config.file=/etc/loki/local-config.yaml

  promtail:
    image: grafana/promtail:1.4.1
    volumes:
      - /var/lib/docker/containers:/var/lib/docker/containers
      - /var/www/nt_devops/monitoring/docker-config.yml:/etc/promtail/docker-config.yml
    command: -config.file=/etc/promtail/docker-config.yml

  grafana:
    image: grafana/grafana:master
    ports:
      - "9095:3000"
    volumes:
      - grafana_data:/var/lib/grafana
      - grafana:/etc/grafana
   

volumes:
  grafana_data:
  grafana:

Here is my grafana container logs

2-23T05:11:55+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=10.0.0.2 time_ms=35 size=48 referer=https://grafana.example.com/alerting/notification/1/edit
t=2022-02-23T05:11:58+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=0 remote_addr=10.0.0.2 time_ms=1 size=0 referer=
t=2022-02-23T05:12:00+0000 lvl=info msg="Sending telegram notification" logger=alerting.notifier.telegram chat_id=-654204299 bot_token=5145999542:AAH16mk4Vh__sHh9JMnhdoNtELbRuuflbI4 apiAction=sendMessage
t=2022-02-23T05:12:00+0000 lvl=eror msg="Failed to send webhook" logger=alerting.notifier.telegram error="Webhook response status 400 Bad Request" webhook=grafana_telegram
t=2022-02-23T05:12:00+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:12:00+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:12:00+0000 lvl=eror msg="Failed to send alert notifications" logger=context userId=1 orgId=1 uname=admin error="Webhook response status 400 Bad Request" remote_addr=10.0.0.2

2-23T05:12:00+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=10.0.0.2 time_ms=34 size=48 referer=https://grafana.example.com/alerting/notification/1/edit
t=2022-02-23T05:16:36+0000 lvl=info msg="Sending telegram notification" logger=alerting.notifier.telegram chat_id=-654204299 bot_token=5145999542:AAH16mk4Vh__sHh9JMnhdoNtELbRuuflbI4 apiAction=sendMessage
t=2022-02-23T05:16:36+0000 lvl=eror msg="Failed to send webhook" logger=alerting.notifier.telegram error="Webhook response status 400 Bad Request" webhook=grafana_telegram
t=2022-02-23T05:16:36+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:16:36+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Webhook response status 400 Bad Request"
t=2022-02-23T05:16:36+0000 lvl=eror msg="Failed to send alert notifications" logger=context userId=1 orgId=1 uname=admin error="Webhook response status 400 Bad Request" remote_addr=10.0.0.2

I am using host network no any other networks. I think it is networking issue

Here is browser console errors

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文