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

Minor changes in mysql error code reported by Prometheus exporter #4290

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/MySQL_HostGroups_Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ void MySQL_HostGroups_Manager::p_update_mysql_error_counter(p_mysql_error_type e
std::string s_port = std::to_string(port);
// TODO: Create switch here to classify error codes
std::string s_code = std::to_string(code);
std::string metric_id = s_hostgroup + ":" + address + ":" + s_port;
std::string metric_id = s_hostgroup + ":" + address + ":" + s_port + ":" + s_code;
std::map<string, string> metric_labels {
{ "hostgroup", s_hostgroup },
{ "address", address },
Expand Down
2 changes: 1 addition & 1 deletion lib/MySQL_Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ bool MySQL_Monitor_State_Data::create_new_connection() {
if (myrc==NULL) {
mysql_error_msg=strdup(mysql_error(mysql));
int myerrno=mysql_errno(mysql);
MyHGM->p_update_mysql_error_counter(p_mysql_error_type::mysql, hostgroup_id, hostname, port, myerrno);
MyHGM->p_update_mysql_error_counter(p_mysql_error_type::proxysql, hostgroup_id, hostname, port, myerrno);
if (myerrno < 2000) {
mysql_close(mysql);
} else {
Expand Down
Loading