swarmprom icon indicating copy to clipboard operation
swarmprom copied to clipboard

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

Open saiharshitachava opened this issue 5 years ago • 3 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

saiharshitachava avatar Apr 02 '19 13:04 saiharshitachava

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 avatar Apr 04 '19 16:04 jonathanmf

@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?

frejonb avatar Apr 05 '19 04:04 frejonb

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

Its working now

saiharshitachava avatar Apr 05 '19 09:04 saiharshitachava