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

Is the query node_meta working which provides the hostname in the metrics #104

Open
saiharshitachava opened this issue Apr 2, 2019 · 3 comments

Comments

@saiharshitachava
Copy link

I was trying to use node-exporter customized image and gave the below configs and deployed.
But I dint see the data populated in the Swarm Node overview dashboard

nodeexporter_eng:
image: stefanprodan/swarmprom-node-exporter:v0.16.0
environment:
- NODE_ID={{.Node.ID}}
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /etc/hostname:/etc/nodename
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points="^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)"'
- '--collector.filesystem.ignored-fs-types="^(sys|proc|auto|cgroup|devpts|ns|au|fuse.lxc|mqueue)(fs|)$$"'
deploy:
mode: global
placement:
constraints:
# Hostname of the first woker node!
- node.platform.arch == x86_64
networks:
- frontend

@jonathanmf
Copy link

jonathanmf commented Apr 4, 2019

Same issue here :( This is the error for the node-exporter container :

invalid mount config for type "bind": bind source path does not exist: /etc/hostname

Any solution?

@frejonb
Copy link

frejonb commented Apr 5, 2019

@jonathanmf that depends on your operating system, if it doesn't store the hostname in /etc/hostname then it won' be able to mount it.

@saiharshitachava if you query prometheus for node_meta what do you get?

@saiharshitachava
Copy link
Author

In my case I forgot to add this in the command..- '--collector.textfile.directory=/etc/node-exporter/'

Its working now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants