stefanprodan / swarmprom

Docker Swarm instrumentation with Prometheus, Grafana, cAdvisor, Node Exporter and Alert Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Swarm Nodes dashboard empty

paulmorabito opened this issue · comments

Hi,

I've taken your sample code, changed a little and upgraded to most recent versions so I understand if you can't provide support. I've managed to get everything working really well with the exception of the Docker Swarm Nodes dashboard. No system information is displayed (CPU, RAM etc.) The same goes for the services dashboard (no CPU or RAM info) but all docker and other related info is working fine.

My compose file for node-exporter looks like this:

  node-exporter:
    image: prom/node-exporter:v0.18.1
    networks:
      - net
    environment:
      - NODE_ID={{.Node.ID}}
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
      - /etc/hostname:/etc/nodename
      - node-exporter:/etc/node-exporter
    command:
      - '--path.sysfs=/host/sys'
      - '--path.procfs=/host/proc'
      - '--collector.textfile.directory=/etc/node-exporter/'
      - '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
      - '--no-collector.ipvs'
    deploy:
      mode: global
      resources:
        limits:
          memory: 128M
        reservations:
          memory: 64M

I created a volume for /etc/node-exporter as it was throwing an error without it.

When I'm looking at the dashboard in Grafana there is an option for swarm node but the only option is All. So, it looks like the node ID is not being populated.

docker node ls gives the following:

ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
0d664sdtzy1f8akrnfy9f7rqt *   swarm01             Ready               Active              Leader              19.03.8�

What I have tried/verified:

  • I can confirm node-exporter is logging to Prometheus.
  • I can confirm Prometheus reports node-exporter data to Grafana because I can install other dashboards and see the same info.
  • /etc/hostname is not null.
  • There is currently only one node in the swarm.
  • Reverting back to the image provided here yields the same result.

Any ideas on how I could fix this would be very appreciated.

Managed to fix this by using the Dockerfile with some modifications to rebuild the image to include the entrypoint shell script.