Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get "http://hostIP:9182/metrics": context deadline exceeded #1580

Open
MjayTafe opened this issue Aug 21, 2024 · 4 comments
Open

Get "http://hostIP:9182/metrics": context deadline exceeded #1580

MjayTafe opened this issue Aug 21, 2024 · 4 comments

Comments

@MjayTafe
Copy link

Problem Statement

I have install windows exporter on azure HCL node via powershell, I can see all data coming from port. but when i add to promethues it shows Get "http://10.176.2.25:9182/metrics": context deadline exceeded I can see other windows 2022 servers fine. except hci OS
firewall port = ok
crape_configs:

  • job_name: 'windows_exporter_2'
    scrape_interval: 25s # Scrape interval for this job
    scrape_timeout: 15s # Increase scrape timeout to a reasonable value
    tls_config:
    insecure_skip_verify: true # Skip TLS verification if needed
    static_configs:
    • targets: ['10.176.2.25:9182' ]

Environment

  • windows_exporter Version:
  • Windows Server Version:
@sandman98321
Copy link

There seems to be something off with the firewall settings the exporter install sets up, or the documentation is missing a necessary step. I was working on this tonight and had the same problem.

To add something more formal in terms of this being a bug or doc issue:

Windows 10 Pro, Version 22H2, build 19045.4780
Prom running in Portainer Stack on a Proxmox VM. All are on same subnet and no other VLANS on this network. Multiple other exports are working without problem. Prom build 2.53.1. windows_exporter version 0.27.2.

Steps to replicate:
New install--start the .msi, allow the install to proceed.
Allow Private Network access when prompted.

curl localhost:9182/metrics works fine at this point.

Prometheus/Targets/Status gives the context deadline exceeded error for that endpoint. Additionally, curl [desktop ip]:9182/metrics times out from any computer other than the Windows PC. Scrape interval and timeout make no difference. Letting curl sit there for 5 minutes got no data.

Testing/"Fix":
Completely disabling the Defender Private Network Firewall results in an immediately working config in Prometheus, and curl from any other computer on local network being able to poll the data.

My suspicion: Either the app needs to be allowed through Public Network because "Windows Defender" reasons, or the Prom server needs to be whitelisted on the Windows side as an allowed inbound connection. I probably won't get to test that till the weekend.

Anyone have any other ideas?

Prom excerpt:

- job_name: [windows pc name here]
  honor_timestamps: true
  scrape_interval: 30s
  scrape_timeout: 60s
  metrics_path: /metrics
  scheme: http
  static_configs:
  - targets: ['[desktop ip]:9182']

@jkroepke
Copy link
Member

I guess the important change is that one: #1447

And I have more to hight it.

The README says, if you want the firewall exception (which was created automaticly before) you have to run the msi with additional flags:

msiexec /i <path-to-msi-file> ADD_FIREWALL_EXCEPTION=yes
@sandman98321
Copy link

Soo...I have a firewall exception that's enabled in there for allow inbound, when on private network on windows_exporter (I think because the .msi prompted me and asked if I wanted to add one? I know for sure I didn't create it. Thinking back, I did also run the .exe first, but since that left me with an open cmd window, I ran the .msi assuming the .exe wasn't an actual installer.).

I'll re-test this weekend and get back to you when I have time to uninstall and reinstall.

@MjayTafe
Copy link
Author

I have installed Prometheus on CentOS, I checked with windows Prometheus client and that works well. issue only with windows host to centOS Prometheus .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants