percona/pmm

Make listen interface of exporters configurable

Closed this issue · 3 comments

fxedel commented

Description

By default, node_exporter listens on 0.0.0.0:42000. Only the port is configurable (via PMM_AGENT_PORTS_MIN), but not the interface / IP.

The exporter's listen address is configured via --web.listen-address, which is set to ":{{ .listen_port }}"

"--web.listen-address=:" + tdp.Left + " .listen_port " + tdp.Right,

So the IP address is omitted, leading to 0.0.0.0.

When using pmm-agent in push mode, I suspect there is no reason to publish these ports on all interfaces.

Suggested solution

Add configuration parameters to set the listen interface for each (or all?) exporter.

This would result in something like:

node_exporter [...] --web.listen-address=="{{ .listen_interface }}:{{ .listen_port }}"

Additional context

# pmm-admin --version
ProjectName: pmm-admin
Version: 2.33.0
PMMVersion: 2.33.0
Timestamp: 2022-12-06 17:15:21 (UTC)
FullCommit: 1cc0dd29c13ca7a8fd0ea16760af48b8eba890b6

Code of Conduct

  • I agree to follow this project's Code of Conduct

We got new Feature request in Jira recently, please follow it there. https://jira.percona.com/browse/PMM-12422

hi @BupycHuk we need to pass the listen interface in managed/services/agents/state.go in fuction
params, err := nodeExporterConfig(node, row, pmmAgentVersion, "0.0.0.0")
if err != nil {
return err
}
Replace "0.0.0.0" with the desired IP address is there any reference code to get the interface string

Azanul commented

May I take this up?