Exportes should not bind on 0.0.0.0 if push mode is used
Description
How to test
Register pmm-agent (with `pmm-agent setup command`) with and without the `expose-exporter` flag (and with metrics mode set to push). In the first case, node exporter should be running on 0.0.0.0, but on 127.0.0.1 in the second case.
Add a new service to PMM with and without the `expose-exporter` flag (an, In the first case, node exporter should be running on 0.0.0.0, but on 127.0.0.1 in the second case.
In the database, agents should also have an expose_exporter that reflects the value of the flag.
How to document
By default, exporters now use localhost (127.0.0.1) when running in push mode, and the public address (0.0.0.0) when running in pull mode.
We're adding a new `expose-exporter` flag to both:
`pmm-admin add` command. When this flag is enabled, the exporter created for that service will use the 0.0.0.0 address.
`pmm-agent setup` command. When this flag is enabled, the node exporter for that agent will use the 0.0.0.0 address.
AFFECTED CS IDs
Activity

saikumar.vs November 27, 2023 at 2:00 PM
verified with latest fix, pls see testacase section for further details.

Roma Novikov August 21, 2023 at 9:38 AM
As an option: allow users to specify IP to run an exporter and keep the current behavior as is.
There's no need to bind exporters to 0.0.0.0 if the push mode is used, as the data from it is pulled locally.
vmagent
is already listening on localhost only.Suggested implementation:
All current installation keep their current behavior
New installations by default will be restricted by 127.0.0.1(push) or IP registered in PMM Server(pull)
Users who would like to monitor using 3rd party tools will be able to enable restrictions and select listen port