【Prometheus】

【Prometheus系列】Grafana升级到8.3.1导致MySQL仪表盘图像异常

1、问题描述

升级 grafana-server 到 8.3.1,仪表盘 MySQL 相关监控信息展示异常,监控仪表盘如图所示:
监控图像
部分监控信息展示异常,报错信息如图:
报错信息

2 、问题定位

2.1 检查Prometheus监控状态

Prometheus界面Targets mysql_exporter 插件信息收集正常
在这里插入图片描述

2.2 检查grafana-server状态

grafana服务有报错

[root@dev-dba-office~]# systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: disabled)
   Active: active (running) since 四 2022-01-20 11:34:04 CST; 5h 14min ago
     Docs: http://docs.grafana.org
 Main PID: 21023 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           └─21023 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=rpm cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins cfg:default.paths.provisioning=/etc/grafana/provisioning

1月 20 16:45:07 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:07+0800 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: time: invalid duration \"$interval\"" remote_addr=192.168.*.*
1月 20 16:45:07 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:07+0800 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=500 remote_addr=192.168.*.* time_ms=2 size=34 referer="http://dev-dba-monitor.cn:3000/d/d_jIN8eMz/mysql-jian-kong?orgId=1&refresh=1m"
1月 20 16:45:07 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:07+0800 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: time: invalid duration \"$interval\"" remote_addr=192.168.*.*
1月 20 16:45:07 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:07+0800 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=500 remote_addr=192.168.*.* time_ms=0 size=34 referer="http://dev-dba-monitor.cn:3000/d/d_jIN8eMz/mysql-jian-kong?orgId=1&refresh=1m"
1月 20 16:45:07 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:07+0800 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: time: invalid duration \"$interval\"" remote_addr=192.168.*.*
1月 20 16:45:07 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:07+0800 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=500 remote_addr=192.168.*.* time_ms=0 size=34 referer="http://dev-dba-monitor.cn:3000/d/d_jIN8eMz/mysql-jian-kong?orgId=1&refresh=1m"
1月 20 16:45:08 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:08+0800 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: time: invalid duration \"$interval\"" remote_addr=192.168.*.*
1月 20 16:45:08 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:08+0800 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=500 remote_addr=192.168.*.* time_ms=1 size=34 referer="http://dev-dba-monitor.cn:3000/d/d_jIN8eMz/mysql-jian-kong?orgId=1&refresh=1m"
1月 20 16:45:08 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:08+0800 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: time: invalid duration \"$interval\"" remote_addr=192.168.*.*
1月 20 16:45:08 dev-dba-office grafana-server[21023]: t=2022-01-20T16:45:08+0800 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=500 remote_addr=192.168.*.* time_ms=0 size=34 referer="http://dev-dba-monitor.cn:3000/d/d_jIN8eMz/mysql-jian-kong?orgId=1&refresh=1m"

3、问题解决

修改Grafana 的数据源 Data Sources ,将Access改成:Browser
在这里插入图片描述

Help:
Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else is stated.

Server access mode (Default):
All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the grafana backend/server if you select this access mode.

Browser access mode:
All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode.

更改后,监控图像恢复正常
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值