Closed arbulu89 closed 5 years ago
Looks good to me. I am not sure if it fully automated is the best, but we can easily change it in the future to allow the customer to point specific users to each tenant, if it is the case.
Looks good to me. I am not sure if it fully automated is the best, but we can easily change it in the future to allow the customer to point specific users to each tenant, if it is the case.
As far as I know, with the SYSTEM
user (used to connect to the System Database) they should be able to connect to all tenants, right?
We could add some additional configuration in the config file to add custom users as you said anyway (a list with user/password for each database, and if it's not set use the SYSTEM user).
Nothing complicated. With the current code, there is always the chance to start new hanadb_exporter daemons with custom data and disabling the multi_tenant
option, so at least a workaround is available and the metrics would be the same for grafana.
Looks good to me. I am not sure if it fully automated is the best, but we can easily change it in the future to allow the customer to point specific users to each tenant, if it is the case.
As far as I know, with the
SYSTEM
user (used to connect to the System Database) they should be able to connect to all tenants, right?
The SYSTEM user is a super user, that is why it is not a good practice to use it in any case. It is like using root user on linux. Anyway, the customer can create a monitoring user with limited access and use the same user/pass for all databases.
We could add some additional configuration in the config file to add custom users as you said anyway (a list with user/password for each database, and if it's not set use the SYSTEM user).
I would do it in the future, if we need it. This has a easy implementation and could be done really fast.
This PR implements the multiple tenant monitoring finding them automatically.
It provides the option to enable multi tenant passing the system database port or just single tenant using the
multi_tenant: false
option in the configuration file.This PR is just a RFC, so let's talk about the utility of this logic.
The other option is just to let the code as it is, and start several daemons with the sql port of each database.
The result will be exactly the same for prometheus regarding the metrics (except you need to change the prometheus configuration to scrape from all the exporters)
INFO: Forget the 1st commit, it's the same than the other PR: https://github.com/SUSE/hanadb_exporter/pull/44