-
Notifications
You must be signed in to change notification settings - Fork 762
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 for scraping multiple mysqld hosts #651
Conversation
Nice, thanks for picking this up. |
CC @sysadmind who is working on similar support for the postgres_exporter. We're using an INI style file here, rather than yaml, since it's more MySQL style. |
This comment was marked as resolved.
This comment was marked as resolved.
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.
I think that this PR is functionally correct. I would prefer to see this align with the /probe
pattern as outlined by the prometheus docs, but otherwise, I think things look good in general.
This comment was marked as resolved.
This comment was marked as resolved.
@sysadmind @SuperQ Probe endpoint is added now. Config could probably be handled a bit better as @sysadmind has done on postgres_exporter but due to time constraint I only refactored the parsing. I have yet to update / clean up documentation so ignore that for now, would appreciate any feedback on the implementation. |
Nice, thanks. I'll take a look at this soon. |
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Updated documentation and some overall cleanup from the previous implementation. Do you want me to add anything to the changelog or do you handle that on release? |
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.
LGTM @SuperQ should be able to comment on the Changelog. I'm not familiar with the release process for this project.
So I mentioned removing ENV var support in #306. I'm wondering if we should include some basic command line / ENV replacement for this. Maybe if we just had This could help issues like #458, we could properly escape passwords in the connection string to the MySQL driver. I think we still want to support the sidecar use case easily, without a config file for credentials. |
If we want to support sidecar I would say we would probably need to have both My proposal if we want to have this replacement for |
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
For configuration that's not in the file, we prefer command line arguments over env vars. The only exception needed is for secrets. So rather than |
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Thanks for commenting so fast. While I understand your line of thinking, I don't fully agree with going for that approach. If a user still needs to set an environment variable (for the password) I feel that we are better off having all of these as environment variables. The only use-case where you don't need to set an environment variable in that case is for servers that do not require a password. So in short, I would rather keep it as-is now, but if you insist it should be quite easy to fix by bringing in the arguments to |
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
Signed-off-by: Mattias Ängehov <mattias.angehov@castoredc.com>
LGTM |
Let's do this! |
so how to configure multiple hosts and ports ?
and configure prometheus.yml file like this:
the mysqld exporter reports error information like this : so , it seems must set host and port in some where other than prometheus.yml , if not ,the defautl 127.0.0.1:3306 is used . any one can make it clear where to set the different hosts and ports ? |
@yinshurman looks like not release yet? |
The documentation is missing that I.e.
|
You need to compile it yourself, there is no release for the commits in this PR. |
@MattiasAng Any plans to release this (support to monitor multiple mysql DB's) in helm? We also have a use case to monitor multiple AWS RDS instances. |
BREAKING CHANGES: The exporter no longer supports the monolithic `DATA_SOURCE_NAME` enviornment variable. To configure connections to MySQL you can either use a `my.cnf` style config file or command line arguments. For example: export MYSQLD_EXPORTER_PASSWORD=secret mysqld_exporter --mysqld.address=localhost:3306 --mysqld.username=exporter * [CHANGE] Allow tlsCfg.InsecureSkipVerify outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [FEATURE] Support for multi-target mysqld probes #651 Signed-off-by: SuperQ <superq@gmail.com>
BREAKING CHANGES: The exporter no longer supports the monolithic `DATA_SOURCE_NAME` enviornment variable. To configure connections to MySQL you can either use a `my.cnf` style config file or command line arguments. For example: export MYSQLD_EXPORTER_PASSWORD=secret mysqld_exporter --mysqld.address=localhost:3306 --mysqld.username=exporter * [CHANGE] Allow tlsCfg.InsecureSkipVerify outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [FEATURE] Support for multi-target mysqld probes #651 Signed-off-by: SuperQ <superq@gmail.com>
BREAKING CHANGES: The exporter no longer supports the monolithic `DATA_SOURCE_NAME` environment variable. To configure connections to MySQL you can either use a `my.cnf` style config file or command line arguments. For example: export MYSQLD_EXPORTER_PASSWORD=secret mysqld_exporter --mysqld.address=localhost:3306 --mysqld.username=exporter We have also dropped some internal scrape metrics: * `mysql_exporter_scrapes_total` * `mysql_exporter_scrape_errors_total` * `mysql_last_scrape_failed` Changes: * [CHANGE] Allow tlsCfg.InsecureSkipVerify outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [CHANGE] Fix shared metrics between requests #722 * [FEATURE] Add support for collecting metrics from sys.user_summary #628 * [FEATURE] Support for multi-target mysqld probes #651 * [FEATURE] Add MySQL TLS configurations #718 * [BUGFIX] Fix infoSchemaInnodbMetricsEnabledColumnQuery #687 Signed-off-by: SuperQ <superq@gmail.com>
BREAKING CHANGES: The exporter no longer supports the monolithic `DATA_SOURCE_NAME` environment variable. To configure connections to MySQL you can either use a `my.cnf` style config file or command line arguments. For example: export MYSQLD_EXPORTER_PASSWORD=secret mysqld_exporter --mysqld.address=localhost:3306 --mysqld.username=exporter We have also dropped some internal scrape metrics: * `mysql_exporter_scrapes_total` * `mysql_exporter_scrape_errors_total` * `mysql_last_scrape_failed` Changes: * [CHANGE] Allow tlsCfg.InsecureSkipVerify outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [CHANGE] Fix shared metrics between requests #722 * [FEATURE] Add support for collecting metrics from sys.user_summary #628 * [FEATURE] Support for multi-target mysqld probes #651 * [FEATURE] Add MySQL TLS configurations #718 * [BUGFIX] Fix infoSchemaInnodbMetricsEnabledColumnQuery #687 Signed-off-by: SuperQ <superq@gmail.com>
* [CHANGE] Allow `tlsCfg.InsecureSkipVerify` outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [CHANGE] Fix shared metrics between requests #722 * [FEATURE] Add support for collecting metrics from `sys.user_summary` #628 * [FEATURE] Support for multi-target mysqld probes #651 * [FEATURE] Add MySQL TLS configurations #718 * [ENHANCEMENT] Add UNIX domain socket support for multi-target scraping #707 * [BUGFIX] Fix `infoSchemaInnodbMetricsEnabledColumnQuery` #687 * [BUGFIX] Allow empty passwords #742 Signed-off-by: SuperQ <superq@gmail.com>
* [CHANGE] Allow `tlsCfg.InsecureSkipVerify` outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [CHANGE] Fix shared metrics between requests #722 * [FEATURE] Add support for collecting metrics from `sys.user_summary` #628 * [FEATURE] Support for multi-target mysqld probes #651 * [FEATURE] Add MySQL TLS configurations #718 * [ENHANCEMENT] Add UNIX domain socket support for multi-target scraping #707 * [BUGFIX] Fix `infoSchemaInnodbMetricsEnabledColumnQuery` #687 * [BUGFIX] Allow empty passwords #742 Signed-off-by: SuperQ <superq@gmail.com>
BREAKING CHANGES: The exporter no longer supports the monolithic `DATA_SOURCE_NAME` environment variable. To configure connections to MySQL you can either use a `my.cnf` style config file or command line arguments. For example: export MYSQLD_EXPORTER_PASSWORD=secret mysqld_exporter --mysqld.address=localhost:3306 --mysqld.username=exporter We have also dropped some internal scrape metrics: - `mysql_exporter_scrapes_total` - `mysql_exporter_scrape_errors_total` - `mysql_last_scrape_failed` The default client configuration file is now `.my.cnf` in the process working directory. Use `--config.my-cnf="$HOME/.my.cnf"` to retain the previous default. Changes: * [CHANGE] Allow `tlsCfg.InsecureSkipVerify` outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [CHANGE] Fix shared metrics between requests #722 * [CHANGE] Allow empty passwords #742 * [CHANGE] Don't use HOME env in the my-cnf config path. #745 * [FEATURE] Add support for collecting metrics from `sys.user_summary` #628 * [FEATURE] Support for multi-target mysqld probes #651 * [FEATURE] Add MySQL TLS configurations #718 * [FEATURE] Add config reload via /-/reload #734 * [ENHANCEMENT] Add UNIX domain socket support for multi-target scraping #707 * [ENHANCEMENT] Use `STRAIGHT_JOIN` in infoSchemaAutoIncrementQuery #726 * [BUGFIX] Fix `infoSchemaInnodbMetricsEnabledColumnQuery` #687 * [BUGFIX] Allow empty passwords #742 Signed-off-by: SuperQ <superq@gmail.com>
BREAKING CHANGES: The exporter no longer supports the monolithic `DATA_SOURCE_NAME` environment variable. To configure connections to MySQL you can either use a `my.cnf` style config file or command line arguments. For example: export MYSQLD_EXPORTER_PASSWORD=secret mysqld_exporter --mysqld.address=localhost:3306 --mysqld.username=exporter We have also dropped some internal scrape metrics: - `mysql_exporter_scrapes_total` - `mysql_exporter_scrape_errors_total` - `mysql_last_scrape_failed` The default client configuration file is now `.my.cnf` in the process working directory. Use `--config.my-cnf="$HOME/.my.cnf"` to retain the previous default. Changes: * [CHANGE] Allow `tlsCfg.InsecureSkipVerify` outside of mTLS #631 * [CHANGE] Update to exporter-toolkit v0.8.1 #677 * [CHANGE] Fix shared metrics between requests #722 * [CHANGE] Allow empty passwords #742 * [CHANGE] Don't use HOME env in the my-cnf config path. #745 * [FEATURE] Add support for collecting metrics from `sys.user_summary` #628 * [FEATURE] Support for multi-target mysqld probes #651 * [FEATURE] Add MySQL TLS configurations #718 * [FEATURE] Add config reload via /-/reload #734 * [ENHANCEMENT] Add UNIX domain socket support for multi-target scraping #707 * [ENHANCEMENT] Use `STRAIGHT_JOIN` in infoSchemaAutoIncrementQuery #726 * [BUGFIX] Fix `infoSchemaInnodbMetricsEnabledColumnQuery` #687 * [BUGFIX] Allow empty passwords #742 Signed-off-by: SuperQ <superq@gmail.com>
This is a continuation on the work done by samitpal in #504 to address PR comments and add
module
parameter support.