Is the query node_meta working which provides the hostname in the metrics
saiharshitachava opened this issue · comments
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
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?
@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?
In my case I forgot to add this in the command..- '--collector.textfile.directory=/etc/node-exporter/'
Its working now