-
Notifications
You must be signed in to change notification settings - Fork 764
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
Add collector for replication_group_members #459
Add collector for replication_group_members #459
Conversation
36b82cd
to
a97a009
Compare
@ezraroi Be happy to get your feedback on this 😄 |
@SuperQ pls review 😅 |
I will test it as I was about to do the same :) |
It works ok however the other question what to do with this. For example, if you have 3 nodes, each reporting 3 states (one per each node including itself), you will get 9 metrics in Prometheus:
Then, any change to member role, state or mysql version will add more metrics like this because those are the label values. Transforming label values into metric values also does not look straight-forward.
Again, the PR looks good :) |
@roman-vynar Thanks for taking the time to look at this and test it ! 😄 imho what is going to the common usage of this is:
I could filter out all other members, so that each exporter will report only on itself. |
I think it's ok and it's up to the end-users to decide how to filter out and alert on. |
We also need to fix another scraper |
Great, sounds good
Sure I'll be happy to add it once this is merged |
I have added one for stats #462 |
Really like what you did there 😃 In order to consistent with what did on the stats I think it'll be better to expose the server's own status only. Agree ? |
In this case it is okay to have all servers states exposed because it is possible each server observes the different picture, e.g. during network partitioning when a half of the nodes are locked down from other. I have seen a few times when member states are reported differently from each node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Can you also add to the CHANGELOG?
* [FEATURE] Add collector for replication_group_members
#459
ee6c8c5
to
c0dc366
Compare
Signed-off-by: Nir Gilboa <[email protected]>
Signed-off-by: Nir Gilboa <[email protected]>
Signed-off-by: Nir Gilboa <[email protected]>
Signed-off-by: Nir Gilboa <[email protected]>
Signed-off-by: Nir Gilboa <[email protected]>
Signed-off-by: Nir Gilboa <[email protected]>
c0dc366
to
d86ab67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better. A couple of minor things left.
…ration, remove duplicate comment Signed-off-by: Nir Gilboa <[email protected]>
fd9faa5
to
20e683f
Compare
Thanks! |
Thanks @SuperQ |
Changes related to `replication_group_member_stats` collector: * metric "transaction_in_queue" was Counter instead of Gauge * renamed 3 metrics starting with `mysql_perf_schema_transaction_` to start with `mysql_perf_schema_transactions_` to be consistent with column names * exposing only server's own stats by matching MEMBER_ID with @@server_uuid resulting "member_id" label to be dropped. * [CHANGE] Switch to go-kit for logs. #433 * [BUGFIX] Fix binlog metrics on mysql 8.x #419 * [BUGFIX] Fix output value of wsrep_cluster_status #473 * [BUGFIX] Fix collect.info_schema.innodb_metrics for new field names (mariadb 10.5+) #494 * [BUGFIX] Fix log output of collect[] params #505 * [BUGFIX] Fix collect.info_schema.innodb_tablespaces for new table names #516 * [BUGFIX] Fix innodb_metrics for mariadb 10.5+ #523 * [BUGFIX] Allow perf_schema.memory summary current_bytes to be negative #517 * [ENHANCEMENT] Support heartbeats in UTC #471 * [FEATURE] Add `tls.insecure-skip-verify` flag to ignore tls verification errors #417 * [FEATURE] Add collector for AWS Aurora information_schema.replica_host_status #435 * [FEATURE] Add collector for `replication_group_members` #459 * [FEATURE] Add new metrics to `replication_group_member_stats` collector to support MySQL 8.x. #462 * [FEATURE] Add collector for `performance_schema.memory_summary_global_by_event_name` #515 * [FEATURE] Support authenticating using mTLS client cert and no password #539 Signed-off-by: Ben Kochie <[email protected]>
BREAKING CHANGES: Changes related to `replication_group_member_stats` collector: * metric "transaction_in_queue" was Counter instead of Gauge * renamed 3 metrics starting with `mysql_perf_schema_transaction_` to start with `mysql_perf_schema_transactions_` to be consistent with column names * exposing only server's own stats by matching MEMBER_ID with @@server_uuid resulting "member_id" label to be dropped. Changes: * [CHANGE] Switch to go-kit for logs. #433 * [FEATURE] Add `tls.insecure-skip-verify` flag to ignore tls verification errors #417 * [FEATURE] Add collector for AWS Aurora information_schema.replica_host_status #435 * [FEATURE] Add collector for `replication_group_members` #459 * [FEATURE] Add new metrics to `replication_group_member_stats` collector to support MySQL 8.x. #462 * [FEATURE] Add collector for `performance_schema.memory_summary_global_by_event_name` #515 * [FEATURE] Support authenticating using mTLS client cert and no password #539 * [ENHANCEMENT] Support heartbeats in UTC #471 * [BUGFIX] Fix binlog metrics on mysql 8.x #419 * [BUGFIX] Fix output value of wsrep_cluster_status #473 * [BUGFIX] Fix collect.info_schema.innodb_metrics for new field names (mariadb 10.5+) #494 * [BUGFIX] Fix log output of collect[] params #505 * [BUGFIX] Fix collect.info_schema.innodb_tablespaces for new table names #516 * [BUGFIX] Fix innodb_metrics for mariadb 10.5+ #523 * [BUGFIX] Allow perf_schema.memory summary current_bytes to be negative #517 Signed-off-by: Ben Kochie <[email protected]>
BREAKING CHANGES: Changes related to `replication_group_member_stats` collector: * metric "transaction_in_queue" was Counter instead of Gauge * renamed 3 metrics starting with `mysql_perf_schema_transaction_` to start with `mysql_perf_schema_transactions_` to be consistent with column names * exposing only server's own stats by matching MEMBER_ID with @@server_uuid resulting "member_id" label to be dropped. Changes: * [CHANGE] Switch to go-kit for logs. #433 * [FEATURE] Add `tls.insecure-skip-verify` flag to ignore tls verification errors #417 * [FEATURE] Add collector for AWS Aurora information_schema.replica_host_status #435 * [FEATURE] Add collector for `replication_group_members` #459 * [FEATURE] Add new metrics to `replication_group_member_stats` collector to support MySQL 8.x. #462 * [FEATURE] Add collector for `performance_schema.memory_summary_global_by_event_name` #515 * [FEATURE] Support authenticating using mTLS client cert and no password #539 * [ENHANCEMENT] Support heartbeats in UTC #471 * [BUGFIX] Fix binlog metrics on mysql 8.x #419 * [BUGFIX] Fix output value of wsrep_cluster_status #473 * [BUGFIX] Fix collect.info_schema.innodb_metrics for new field names (mariadb 10.5+) #494 * [BUGFIX] Fix log output of collect[] params #505 * [BUGFIX] Fix collect.info_schema.innodb_tablespaces for new table names #516 * [BUGFIX] Fix innodb_metrics for mariadb 10.5+ #523 * [BUGFIX] Allow perf_schema.memory summary current_bytes to be negative #517 Signed-off-by: Ben Kochie <[email protected]>
BREAKING CHANGES: Changes related to `replication_group_member_stats` collector: * metric "transaction_in_queue" was Counter instead of Gauge * renamed 3 metrics starting with `mysql_perf_schema_transaction_` to start with `mysql_perf_schema_transactions_` to be consistent with column names * exposing only server's own stats by matching MEMBER_ID with @@server_uuid resulting "member_id" label to be dropped. Changes: * [CHANGE] Switch to go-kit for logs. #433 * [FEATURE] Add `tls.insecure-skip-verify` flag to ignore tls verification errors #417 * [FEATURE] Add collector for AWS Aurora information_schema.replica_host_status #435 * [FEATURE] Add collector for `replication_group_members` #459 * [FEATURE] Add new metrics to `replication_group_member_stats` collector to support MySQL 8.x. #462 * [FEATURE] Add collector for `performance_schema.memory_summary_global_by_event_name` #515 * [FEATURE] Support authenticating using mTLS client cert and no password #539 * [FEATURE] Add TLS and basic authentication #522 * [ENHANCEMENT] Support heartbeats in UTC #471 * [ENHANCEMENT] Improve parsing of boolean strings #548 * [BUGFIX] Fix binlog metrics on mysql 8.x #419 * [BUGFIX] Fix output value of wsrep_cluster_status #473 * [BUGFIX] Fix collect.info_schema.innodb_metrics for new field names (mariadb 10.5+) #494 * [BUGFIX] Fix log output of collect[] params #505 * [BUGFIX] Fix collect.info_schema.innodb_tablespaces for new table names #516 * [BUGFIX] Fix innodb_metrics for mariadb 10.5+ #523 * [BUGFIX] Allow perf_schema.memory summary current_bytes to be negative #517 Signed-off-by: Ben Kochie <[email protected]>
Fixes #362
The scraper sends a new Gauge metric with a static value of 1 and labels corresponding to columns of the replication_group_members table. I made this choice because the labels are very much static - if there's an idea for something more elegant I'm quite happy to change it☺️
Both 5.7 and 8.0 are supported, by way of a different query for each. The first query sent is used to determine whether the additional columns present in the 8.0 schema are there, and falls back to the 5.7 schema.
Hope this makes sense..