Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make listen interface of exporters configurable #2495

Closed
wants to merge 8 commits into from
Closed

Make listen interface of exporters configurable #2495

wants to merge 8 commits into from

Conversation

vishwas-sharma2480
Copy link
Contributor

PR Summary:

This pull request aims to enhance the nodeExporterConfig function to allow configuration of the listen interface for the node_exporter in the [your_project_name] codebase.

Changes Made
Modified the nodeExporterConfig function to accept a listenInterface parameter.
Updated the --web.listen-address argument to include the specified listen interface.
Provided a placeholder for the listenInterface parameter in function calls.
Incomplete Implementation
This change is still incomplete and requires further guidance on how to obtain the listenInterface value from the user or configuration. Currently, the listenInterface is a placeholder that needs to be replaced with the actual method of obtaining this value.

TODO:

Define how the listenInterface should be obtained (e.g., from user input, configuration file, or environment variable).
Implement the logic to retrieve the listenInterface value and pass it to the nodeExporterConfig function.

@vishwas-sharma2480 vishwas-sharma2480 requested a review from a team as a code owner September 20, 2023 21:04
@vishwas-sharma2480 vishwas-sharma2480 requested review from idoqo and artemgavrilov and removed request for a team September 20, 2023 21:04
@it-percona-cla
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ vishwas-sharma2480
❌ codesee-maps[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@artemgavrilov artemgavrilov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vishwas-sharma2480 Please read contribution guideline, it highlights how to setup local environment, build project run test, etc...

Also can you please avoid commits from CodeSee bot in your PRs. Our CLA checker requires every author in a PR to sign agreement and this bot can't do it.

params, err := nodeExporterConfig(node, row, pmmAgentVersion)
//params, err := nodeExporterConfig(node, row, pmmAgentVersion)
listenInterface := "127.0.0.1" // Change this to the desired IP address or interface
params, err := nodeExporterConfig(node, exporter, agentVersion, listenInterface)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is invalid (uncompilable). It should be row instead of exporter and pmmAgnetVersion instead of agentVersion.

"--web.listen-address=:" + tdp.Left + " .listen_port " + tdp.Right,
}
// "--web.listen-address=:" + tdp.Left + " .listen_port " + tdp.Right,
"--web.listen-address=" + listenInterface + ":" + tdp.Left + " .listen_port " + tdp.Right,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be declared here as placeholder, same as .listen_port. And then you pmm-agent should fill it with proper interface. Otherwise it will be the same interface for all nodes.

@artemgavrilov artemgavrilov added go Pull requests that update Go code community Community contribution labels Sep 21, 2023
@ademidoff
Copy link
Member

Please note that CodeSee is not able to sign the Contributor agreement, which is why we won't be technically in a position to merge such PRs. This repository is open source, and we request all committers to sign the Contributor's License Agreement (CLA).

Therefore, what we can suggest is re-create this PR by making sure all contributors can sign the CLA.

@idoqo
Copy link
Contributor

idoqo commented Sep 25, 2023

Hi @vishwas-sharma2480, Thanks a lot for your contribution. If the goal here is to be able to restrict node exporter to 127.0.0.1, we are also working on the issue as well and you can follow the ticket at PMM-12422.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants