I want to be able to scrape metrics exported by mysld_exported from a Prometheus instances that is outside of the PMM.
At the moment the documentation says that the password is autogenerated using the agent-id, but this is a real inconvenient for me because I have a lot of mysql instances and I have to manually define new scrape config for each mysql instance.
I saw in the mysqld_exporter help that it has support for custom authentication using HTTP_AUTH env variable or --web.auth-file=WEB.AUTH-FILE param, but I can’t figure out how to set this param using pmm-admin or pmm-agent. I tried with pmm-admin add mysql --environment HTTP_AUTH=user:pass, but with no luck.
I tried, but your suggestion is setting a custom user/password on communication between pmm-client(s) and pmm-server.
What I need is to be able to set a custom password for the mysld_exporter metrics webpage, in order to be able to get these metrics from an external(outside of PMM environment) Prometheus instance. By default, when a new mysql service is added using ‘pmm-admin add mysql’ the HTTP_AUTH variable is set using the agent-id and I can’t figure it out how to change this default value.
You will most likely need to set the password for both the exporter, and configure your password within PMM server as noted above as well in order for both PMM to function and your custom thing to function.
Unfortunately I didn’t find a way to set web.auth-file/HTTP_AUTH to the exporter trough pmm-admin.
None of the suggested solutions worked. I ended up extracting all agent_ids from all mysql instances and use it as a password for my external prometheus.
Hi @beniamin Your post has caused lots of discussion here. Yes, the exporter itself supports custom un/pw, but only if launched outside of PMM. The ‘pmm-agent’ acts as a supervisor and this is what runs/manages the exporter. Right now, there is no way to pass a custom un/pw config through pmm-agent to pass along to the exporter.
Right now, your options are to do as you’ve done, scraping the agent IDs, or run the exporter by itself, passing the parameter you need and forgo the PMM integration.
@beniamin,
You can disable the exporter authentication completely with the below workaround, which will give you the possibility to scrape the percona mysqld_exporter from a 2nd prometheus instance without affecting the PMM2 server integration.
On rhel/centos >= 7 create the file /usr/local/percona/pmm2/exporters/mysqld_exporter_noauth like below