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

Customize node exporter target #356

Merged
merged 5 commits into from
Nov 28, 2024
Merged

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Nov 27, 2024

Description

Add a new configuration option to give the user the option to choose the node expoter target.

The new parameter is node-exporter-target in the command line and configuration file.
If the option is not used, the code will use the lowest ipv4 address plus the default node exporter port.

And it will send a new field in the host discovery as prometheus_targets with a map[string]string with all the configured exporters.
I have chosen this option to enable future exporters usage. In this case:

{
...
    "prometheus_targets": {
        "node_exporter": "10.1.2.3:9100"
    }
}

How was this tested?

UT

Did you update the documentation?

I added some "in code" documentation, but we will need to add this new value in additional places I guess

@arbulu89 arbulu89 added the enhancement New feature or request label Nov 27, 2024
@arbulu89 arbulu89 force-pushed the customize-node-exporter-target branch from b57c4c4 to 407467f Compare November 27, 2024 13:43
@arbulu89 arbulu89 marked this pull request as ready for review November 27, 2024 13:54
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

LGTM

internal/discovery/host_internal_test.go Outdated Show resolved Hide resolved
@arbulu89 arbulu89 merged commit a443d5c into main Nov 28, 2024
11 checks passed
@arbulu89 arbulu89 deleted the customize-node-exporter-target branch November 28, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants