prometheus-community / windows_exporter

Prometheus exporter for Windows machines
MIT License
2.86k stars 683 forks source link

Grafana doesnt show data from Windows Exporter #1223

Closed joaquinsusin closed 9 months ago

joaquinsusin commented 1 year ago

Hey so I have 2 ec2 instances one is a Prometheus Server with Grafana and the other one is a Windows client with windows exporter, the problem is that when I enter on prometheus and query something like windows_cpu_core_frequency_mhz I see results displaying but when I enter on grafana and add a source of prometheus with http://XX.XX.XX.XX:9182 it says Data source is working but when I try to display anything it says no data.

prometheus.yml

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: "prometheus"
    static_configs:
      - targets: ["localhost:9090", "13.38.53.12:9182"]

  - job_name: 'node-exporter'
    static_configs:
      - targets: ['node-exporter:9100']

  - job_name: 'windows_exporter'
    static_configs:
      - targets: ['13.38.53.12:9182']`

docker-compose.yml

version: "3.9"
services:
  grafana:
    image: grafana/grafana
    ports:
      - "3000:3000"
    volumes:
      - grafana-data:/var/lib/grafana
      - grafana-configs:/etc/grafana
  prometheus:
    image: prom/prometheus
    ports:
      - "9090:9090"
    volumes:
      - prom-data:/prometheus
      - prom-configs:/etc/prometheus
  node-exporter:
    image: prom/node-exporter
    ports:
      - "9100:9100"
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command:
      - '--path.procfs=/host/proc'
      - '--path.sysfs=/host/sys'
      - '--collector.filesystem.mount-points-exclude'
      - '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)'

volumes:
  grafana-data:
  grafana-configs:
  prom-data:
  prom-configs:
breed808 commented 1 year ago

Are you sure a Prometheus source has been added to Grafana? http://XX.XX.XX.XX:9182 implies windows_exporter based on the port, not Prometheus.

github-actions[bot] commented 9 months ago

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

rahilk82 commented 9 months ago

I have added the target with the ip and port of windows on my prometheus configuration file, but it is not showing the job name in the grafana server. But on prometheus server it is working fine.

Anyone please help me out here

breed808 commented 9 months ago

@rahilk82 this sounds like an issue between Grafana and Prometheus, as you've mentioned that Prometheus is successfully scraping windows_exporter. You'll want to confirm connectivity between Grafana and Prometheus when adding the datasource in Grafana.

rahilk82 commented 7 months ago

The node variables are different based on the OS. So due to hangover, I was trying to search Windows Node in Linux Dashboard. Sorry to disturb.

gusarg81 commented 3 months ago

Hi. I am facing the same issue reported here. Prometheus is scrapping successfully from all my Nodes (which are Linux and Windows). I can see is working in Prometheus.

Now, in Grafana I only see the instances inside the job (is one job with many labeled instances) that are Linux Nodes, but the Windows ones does not appears.

Any ideas?