Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Disable collectors #80

Closed
till opened this issue Apr 1, 2019 · 9 comments · Fixed by #81
Closed

Disable collectors #80

till opened this issue Apr 1, 2019 · 9 comments · Fixed by #81
Labels
bug Something isn't working

Comments

@till
Copy link
Contributor

till commented Apr 1, 2019

TASK [cloudalchemy.node-exporter : Assert collectors are not both disabled and enabled at the same time] ***
failed: [host] (item=diskstats) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "diskstats",
    "msg": "Assertion failed"
}
failed: [host] (item=mdadm) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "mdadm",
    "msg": "Assertion failed"
}

I recently updated the role locally and it started failing with the above message. I think this check was introduced in #22. How do you disable what is enabled by this role (by default)? So far, I was using the role and disabled the collectors that I didn't need and it worked — node-exporter didn't use the collector for e.g. mdam or diskstats.

With #22, my deploy stalls as the collector is enabled by default, but I can't disable it anymore.

Do I need to now explicitly set all enabled and disabled?

@paulfantom
Copy link
Member

paulfantom commented Apr 1, 2019

Do I need to now explicitly set all enabled and disabled?

Yes, you need to override both node_exporter_enabled_collectors and node_exporter_disabled_collectors. And collector cannot be at the same time in both lists.

@till
Copy link
Contributor Author

till commented Apr 1, 2019

@paulfantom that seems to be new then? I'll go ahead and do that now.

@till
Copy link
Contributor Author

till commented Apr 1, 2019

I believe I set them both "correctly" now, but maybe I mis-understood.

Some sample configurations:

# play.yml
- hosts: all
  roles:
     - { role: cloudalchemy.node-exporter }
# group_vars/all.yml
node_exporter_enabled_collectors:
  - arp
  - bcache
  - bonding
  - boottime
  - conntrack
  - cpu
  - cpufreq
  - edac
  - entropy
  - exec
  - filefd
  - filesystem
  - hwmon
  - ipvs
  - loadavg
  - meminfo
  - netclass
  - netdev
  - netstat
  - sockstat
  - stat
  - textfile
  - time
  - timex
  - uname
  - vmstat
node_exporter_disabled_collectors:
  - diskstats
  - infiniband
  - mdadm
  - nfs
  - nfsd
  - wifi
  - xfs
  - zfs

Error "persists", e.g. it's complaining about e.g, "wifi" which is now only in node_exporter_disabled_collectors. Is there anything I am missing?

Here is a log, it repeats for all my hosts in all — same collectors:

TASK [cloudalchemy.node-exporter : Assert collectors are not both disabled and enabled at the same time] ***
failed: [host] (item=diskstats) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "diskstats",
    "msg": "Assertion failed"
}
failed: [host] (item=infiniband) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "infiniband",
    "msg": "Assertion failed"
}
failed: [host] (item=mdadm) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "mdadm",
    "msg": "Assertion failed"
}
failed: [host] (item=nfs) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "nfs",
    "msg": "Assertion failed"
}
failed: [host] (item=nfsd) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "nfsd",
    "msg": "Assertion failed"
}
failed: [host] (item=wifi) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "wifi",
    "msg": "Assertion failed"
}
failed: [host] (item=xfs) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "xfs",
    "msg": "Assertion failed"
}
failed: [host] (item=zfs) => {
    "assertion": "item in node_exporter_enabled_collectors",
    "changed": false,
    "evaluated_to": false,
    "item": "zfs",
    "msg": "Assertion failed"
}

Again, it seemed to have worked before. Isn't this is a hefty BC break?

@till
Copy link
Contributor Author

till commented Apr 1, 2019

@till
Copy link
Contributor Author

till commented Apr 1, 2019

Am I reading something wrong? Both PRs seem to be in this for over a year, but I am also sure when I initially started using this, it had a full list of enabled collectors in defaults/main.yml.

@paulfantom paulfantom added the bug Something isn't working label Apr 1, 2019
@paulfantom
Copy link
Member

Seems like I introduced a bug with #79. Will fix it soon.

Full list of enabled collectors was removed as we decided to use collectors enabled in node_exporter by default and extend it by using systemd (on which cloudalchemy roles depend) and configure filesystem collector.

@paulfantom
Copy link
Member

paulfantom commented Apr 1, 2019

Should be fixed now.

I see you are based in Berlin, come to next prometheus meetup (April 17th) 😄

@till
Copy link
Contributor Author

till commented Apr 1, 2019

@paulfantom What do I google to find it? I saw one on meetup, but there are no new events listed.

@paulfantom
Copy link
Member

Soon there should be an announcement in https://www.meetup.com/Berlin-Prometheus-Meetup/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants