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

new flag to disable all default collectors #1460

Merged
merged 3 commits into from
Feb 20, 2020

Conversation

pgier
Copy link
Contributor

@pgier pgier commented Aug 28, 2019

No description provided.

Signed-off-by: Paul Gier <pgier@redhat.com>
@pgier pgier force-pushed the disable-default-collectors branch from 6b4da13 to 20782de Compare August 28, 2019 20:10
@SuperQ SuperQ self-requested a review August 29, 2019 07:12
@SuperQ
Copy link
Member

SuperQ commented Aug 29, 2019

I was thinking about doing this by making the const defaultEnabled an object that we can set to false.

@pgier
Copy link
Contributor Author

pgier commented Aug 29, 2019

Maybe I'm missing something, but I'm not sure how that would work because the collectors need to register themselves with the enabled/disabled flag before the flags are parsed. So you wouldn't know whether to set defaultEnabled to true or false, until after it's already been used by the collectors.

@dt-rush
Copy link
Contributor

dt-rush commented Aug 29, 2019

Discussion context on issues:

#735
#1276

@SuperQ
Copy link
Member

SuperQ commented Feb 19, 2020

@pgier Can you resolve the conflicts for this? I'm getting ready to release 1.0.0 and I think this should go in.

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

LGTM!

@discordianfish
Copy link
Member

Yay finally :)

@SuperQ SuperQ merged commit b40954d into prometheus:master Feb 20, 2020
@PMDubuc
Copy link

PMDubuc commented Apr 20, 2020

Why isn't the --collector.disable-defaults flag documented here in the README.md?

@discordianfish
Copy link
Member

I think @SuperQ didn't want to promote usage of that. But not sure. I'd say it should be documented.

@binaryfire
Copy link

binaryfire commented May 24, 2020

I haven't been able to find any documentation on how to use this. Is it as simple as specifying --collector.disable-defaults followed by --collector flags for whatever we want enabled? For example:

ExecStart=/opt/node_exporter/node_exporter
--web.listen-address=127.0.0.1:9100
--collector.disable-defaults
--collector.cpu
--collector.diskstats
--collector.filefd
--collector.filesystem
--collector.loadavg
--collector.meminfo
--collector.netdev
--collector.netstat
--collector.ntp
--collector.sockstat
--collector.stat
--collector.textfile

?

@SuperQ
Copy link
Member

SuperQ commented May 24, 2020

No, I just forgot to update the README with the new flag option.

@tiagosimao
Copy link

Hi there!

Took me quite a while to find this feature.

Can maybe this be updated here? https://github.com/prometheus/node_exporter#collectors. That's where I was hoping to find something about it at least.

For what is worth, my use-case is using node_exporter with nothing but the textfile collector... come to think of it, maybe I should just run an nginx or something like that... feels "righter" to use something from the Prom ecosystem though.

I can PR of course, just want to check first if that's OK.

Awesome work by the way.

@discordianfish
Copy link
Member

@tiagosimao Good point! Yeah would be great if you can submit a PR to mention the flag.

nickatsegment added a commit to nickatsegment/node_exporter that referenced this pull request Feb 11, 2021
Took me ages to find this thing since there's literally nearly 100 other options that look almost the same.

prometheus#1460 (comment) some other person wants this as well. :)
Signed-off-by: Nick Irvine <nick@segment.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* new flag to disable all default collectors

Signed-off-by: Paul Gier <pgier@redhat.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
Took me ages to find this thing since there's literally nearly 100 other options that look almost the same.

prometheus#1460 (comment) some other person wants this as well. :)
Signed-off-by: Nick Irvine <nick@segment.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* new flag to disable all default collectors

Signed-off-by: Paul Gier <pgier@redhat.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
Took me ages to find this thing since there's literally nearly 100 other options that look almost the same.

prometheus#1460 (comment) some other person wants this as well. :)
Signed-off-by: Nick Irvine <nick@segment.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants