Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

PMM-5967 Bind-IP for agent listeners #394

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion services/agents/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ func nodeExporterConfig(node *models.Node, exporter *models.Agent) *agentpb.SetS

"--web.disable-exporter-metrics", // we enable them as a part of HR metrics

"--web.listen-address=:" + tdp.left + " .listen_port " + tdp.right,
"--web.listen-address=" +
tdp.left + " with .listen_address " + tdp.right + tdp.left + " . " + tdp.right + tdp.left + " end " + tdp.right +
":" + tdp.left + " .listen_port " + tdp.right,
}

// do not tweak collectors on macOS as many (but not) of them are Linux-specific
Expand Down
4 changes: 2 additions & 2 deletions services/agents/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestNodeExporterConfig(t *testing.T) {
"--no-collector.xfs",
"--no-collector.zfs",
"--web.disable-exporter-metrics",
"--web.listen-address=:{{ .listen_port }}",
"--web.listen-address={{ with .listen_address }}{{ . }}{{ end }}:{{ .listen_port }}",
},
Env: []string{
"HTTP_AUTH=pmm:agent-id",
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestNodeExporterConfig(t *testing.T) {
"--collector.textfile.directory.lr=/usr/local/percona/pmm2/collectors/textfile-collector/low-resolution",
"--collector.textfile.directory.mr=/usr/local/percona/pmm2/collectors/textfile-collector/medium-resolution",
"--web.disable-exporter-metrics",
"--web.listen-address=:{{ .listen_port }}",
"--web.listen-address={{ with .listen_address }}{{ . }}{{ end }}:{{ .listen_port }}",
},
Env: []string{
"HTTP_AUTH=pmm:agent-id",
Expand Down