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

Support MySQL 8.4 replicas syntax #837

Merged
merged 2 commits into from
May 15, 2024
Merged

Support MySQL 8.4 replicas syntax #837

merged 2 commits into from
May 15, 2024

Conversation

mtanda
Copy link
Contributor

@mtanda mtanda commented May 15, 2024

Summary

In MySQL 8.4, several "Replication SQL syntax" commands have been deprecated, requiring the use of new syntax. During testing, it was confirmed that errors occur with the old syntax. This PR updates the code to be compatible with the new syntax. Could you please review this PR?

Details

The changes address the syntax errors that arise due to the deprecated commands. Below are the specific errors encountered:

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"

For reference, you can find the MySQL 8.4 release notes here: MySQL 8.4 Release Notes.

Thank you for reviewing this PR!

@mtanda mtanda force-pushed the mysql84 branch 2 times, most recently from 1243a11 to 74faaa0 Compare May 15, 2024 06:18
Signed-off-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com>
collector/slave_hosts.go Outdated Show resolved Hide resolved
collector/slave_hosts.go Outdated Show resolved Hide resolved
Signed-off-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com>
@mtanda
Copy link
Contributor Author

mtanda commented May 15, 2024

@SuperQ Thank you for the review! I have addressed the comments and made the necessary changes. Could you please review it again?

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SuperQ SuperQ changed the title support MySQL 8.4 Support MySQL 8.4 replicas syntax May 15, 2024
@SuperQ
Copy link
Member

SuperQ commented May 15, 2024

I suppose we should add MySQL 8.4 to our CI pipeline.

@SuperQ SuperQ merged commit f6a64d7 into prometheus:main May 15, 2024
13 checks passed
@mtanda
Copy link
Contributor Author

mtanda commented May 15, 2024

Thanks for merge!!

@mtanda mtanda deleted the mysql84 branch May 15, 2024 08:25
@happywzy
Copy link

Which version of docker solves this problem?

oblitorum pushed a commit to shatteredsilicon/mysqld_exporter that referenced this pull request Oct 16, 2024
* support MySQL 8.4

Signed-off-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com>
---------

Signed-off-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com>
cristiangreco added a commit to grafana/mysqld_exporter that referenced this pull request Nov 8, 2024
Changes:
* [FEATURE] Support for prometheus scrape timeout in probe endpoint prometheus#828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax prometheus#837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema prometheus#862
* [ENHANCEMENT] Add the instance struct to handle connections prometheus#859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib prometheus#844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema prometheus#853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 prometheus#860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days prometheus#841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches prometheus#833
* [BUGFIX] Fix race condition in ReloadConfig prometheus#760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode prometheus#684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 prometheus#683
* [BUGFIX] Update docker registry link in README.md prometheus#813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling prometheus#843
@cristiangreco cristiangreco mentioned this pull request Nov 8, 2024
cristiangreco added a commit to grafana/mysqld_exporter that referenced this pull request Nov 8, 2024
Changes:
* [FEATURE] Support for prometheus scrape timeout in probe endpoint prometheus#828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax prometheus#837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema prometheus#862
* [ENHANCEMENT] Add the instance struct to handle connections prometheus#859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib prometheus#844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema prometheus#853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 prometheus#860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days prometheus#841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches prometheus#833
* [BUGFIX] Fix race condition in ReloadConfig prometheus#760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode prometheus#684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 prometheus#683
* [BUGFIX] Update docker registry link in README.md prometheus#813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling prometheus#843

Signed-off-by: Cristian Greco <cristian@regolo.cc>
cristiangreco added a commit to grafana/mysqld_exporter that referenced this pull request Nov 8, 2024
Changes:
* [FEATURE] Support for prometheus scrape timeout in probe endpoint prometheus#828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax prometheus#837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema prometheus#862
* [ENHANCEMENT] Add the instance struct to handle connections prometheus#859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib prometheus#844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema prometheus#853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 prometheus#860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days prometheus#841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches prometheus#833
* [BUGFIX] Fix race condition in ReloadConfig prometheus#760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode prometheus#684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 prometheus#683
* [BUGFIX] Update docker registry link in README.md prometheus#813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling prometheus#843

Signed-off-by: Cristian Greco <cristian@regolo.cc>
cristiangreco added a commit to grafana/mysqld_exporter that referenced this pull request Nov 8, 2024
Changes:
* [CHANGE] Replace logging library go-kit/log with slog prometheus#885
* [FEATURE] Support for prometheus scrape timeout in probe endpoint prometheus#828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax prometheus#837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema prometheus#862
* [ENHANCEMENT] Add the instance struct to handle connections prometheus#859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib prometheus#844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema prometheus#853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 prometheus#860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days prometheus#841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches prometheus#833
* [BUGFIX] Fix race condition in ReloadConfig prometheus#760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode prometheus#684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 prometheus#683
* [BUGFIX] Update docker registry link in README.md prometheus#813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling prometheus#843
* [BUGFIX] info_schema_tables: do not collect the sys schema prometheus#879

Signed-off-by: Cristian Greco <cristian@regolo.cc>
cristiangreco added a commit to grafana/mysqld_exporter that referenced this pull request Nov 8, 2024
Changes:
* [CHANGE] Replace logging library go-kit/log with slog prometheus#875
* [FEATURE] Support for prometheus scrape timeout in probe endpoint prometheus#828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax prometheus#837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema prometheus#862
* [ENHANCEMENT] Add the instance struct to handle connections prometheus#859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib prometheus#844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema prometheus#853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 prometheus#860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days prometheus#841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches prometheus#833
* [BUGFIX] Fix race condition in ReloadConfig prometheus#760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode prometheus#684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 prometheus#683
* [BUGFIX] Update docker registry link in README.md prometheus#813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling prometheus#843
* [BUGFIX] info_schema_tables: do not collect the sys schema prometheus#879

Signed-off-by: Cristian Greco <cristian@regolo.cc>
SuperQ pushed a commit that referenced this pull request Nov 8, 2024
Changes:
* [CHANGE] Replace logging library go-kit/log with slog #875
* [FEATURE] Support for prometheus scrape timeout in probe endpoint #828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax #837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema #862
* [ENHANCEMENT] Add the instance struct to handle connections #859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib #844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema #853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 #860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days #841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches #833
* [BUGFIX] Fix race condition in ReloadConfig #760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode #684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 #683
* [BUGFIX] Update docker registry link in README.md #813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling #843
* [BUGFIX] info_schema_tables: do not collect the sys schema #879

Signed-off-by: Cristian Greco <cristian@regolo.cc>
SuperQ added a commit that referenced this pull request Nov 8, 2024
* [CHANGE] Replace logging library go-kit/log with slog #875
* [FEATURE] Support for prometheus scrape timeout in probe endpoint #828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax #837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema #862
* [ENHANCEMENT] Add the instance struct to handle connections #859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib #844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema #853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 #860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days #841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches #833
* [BUGFIX] Fix race condition in ReloadConfig #760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode #684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 #683
* [BUGFIX] Update docker registry link in README.md #813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling #843
* [BUGFIX] info_schema_tables: do not collect the sys schema #879

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ mentioned this pull request Nov 8, 2024
SuperQ added a commit that referenced this pull request Nov 8, 2024
* [CHANGE] Replace logging library go-kit/log with slog #875
* [FEATURE] Support for prometheus scrape timeout in probe endpoint #828
* [ENHANCEMENT] Support MySQL 8.4 replicas syntax #837
* [ENHANCEMENT] Fetch lock time and cpu time from performance schema #862
* [ENHANCEMENT] Add the instance struct to handle connections #859
* [ENHANCEMENT] Optimize code by using built-in constants in the standard lib #844
* [BUGFIX] Fix fetching tmpTables vs tmpDiskTables from performance_schema #853
* [BUGFIX] Skip SPACE_TYPE column for MariaDB >=10.5 #860
* [BUGFIX] Fixed parsing of timestamps with non-zero padded days #841
* [BUGFIX] Fix auto_increment metric collection errors caused by using collation in INFORMATION_SCHEMA searches #833
* [BUGFIX] Fix race condition in ReloadConfig #760
* [BUGFIX] Change processlist query to support ONLY_FULL_GROUP_BY sql_mode #684
* [BUGFIX] replication_applier_status_by_worker requires mysql 8.0 #683
* [BUGFIX] Update docker registry link in README.md #813
* [BUGFIX] Fix Docker run command and update documentation for cnf file handling #843
* [BUGFIX] info_schema_tables: do not collect the sys schema #879

Signed-off-by: SuperQ <superq@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants