Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql-exporter adapted for mysql v8.x version #861

Open
xiaoyuan2019 opened this issue Aug 19, 2024 · 6 comments
Open

mysql-exporter adapted for mysql v8.x version #861

xiaoyuan2019 opened this issue Aug 19, 2024 · 6 comments

Comments

@xiaoyuan2019
Copy link

Host operating system: output of uname -a

Linux ksops_test 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

mysqld_exporter version: output of mysqld_exporter --version

/ $ mysqld_exporter --version
mysqld_exporter, version 0.15.1 (branch: HEAD, revision: cc34968)
build user: root@d89c15b9f5ad
build date: 20231212-07:55:09
go version: go1.21.5
platform: linux/amd64
tags: unknown

MySQL server version

v8.0.37

mysqld_exporter command line flags

/bin/mysqld_exporter --web.listen-address=:11010 --web.config.file=/etc/mysql_exporter_auth.yml --mysqld.address=localhost:3306 --mysqld.username=wps

What did you do that produced an error?

image

What did you expect to see?

no error

What did you see instead?

  • SHOW ALL SLAVES STATUS:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALL SLAVES STATUS' at line 1
  • SHOW ALL SLAVES STATUS NONBLOCKING:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALL SLAVES STATUS NONBLOCKING' at line 1
  • SELECT @@query_response_time_stats:Unknown system variable 'query_response_time_stats'
@akushneruk
Copy link

faced the same problem

@cjabrantes
Copy link

Is there any ETA for a version that supports 8.4(namely the new commands to show the status of the replicas/slaves)?

@dellnoantechnp
Copy link

image
The new prom/mysqld-exporter image tag main is already fine.

Not have syntax to use near 'SLAVE HOSTS' log:

mysqld-exporter  | ts=2024-05-15T02:39:40.760Z caller=exporter.go:173 level=error msg="Error from scraper" scraper=slave_status target=mysql_replica:3306 err="Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1"
mysqld-exporter  | ts=2024-05-15T02:43:26.471Z caller=exporter.go:173 level=error msg="Error from scraper" scraper=slave_hosts target=mysql_replica:3306 err="Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE HOSTS' at line 1"

image

@maxant
Copy link

maxant commented Sep 29, 2024

I have something similar but a little different. I just upgraded to MySql 8.4.2 and the latest docker version (0.15.1) of the metrics exporter (version="(version=0.15.1, branch=HEAD, revision=cc349684494b5038ec5a52233bdca9eb9291e6f2)) and I get this in the logs:

ts=2024-09-29T11:15:50.739Z caller=exporter.go:173 level=error msg="Error from scraper" scraper=slave_status target=mysql:3306 err="Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1"

maybe need to upgrade the statement to this one: https://dev.mysql.com/doc/refman/8.4/en/show-replica-status.html

@kofesenko
Copy link

I have something similar but a little different. I just upgraded to MySql 8.4.2 and the latest docker version (0.15.1) of the metrics exporter (version="(version=0.15.1, branch=HEAD, revision=cc349684494b5038ec5a52233bdca9eb9291e6f2)) and I get this in the logs:

ts=2024-09-29T11:15:50.739Z caller=exporter.go:173 level=error msg="Error from scraper" scraper=slave_status target=mysql:3306 err="Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1"

maybe need to upgrade the statement to this one: https://dev.mysql.com/doc/refman/8.4/en/show-replica-status.html

@maxant 0.15.1 is older than main version of the image, and as @dellnoantechnp mentioned that image is already handling new syntax.
Also, as far as I understood exported metrics were also updated to reflect these changes, so, for example mysql_slave_status_slave_sql_running is equal to mysql_slave_status_replica_sql_running for the mysql 8.4.*.

@ascii79
Copy link

ascii79 commented Oct 17, 2024

Any plan to release this on the standalone version ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants