prometheus-community / windows_exporter

Prometheus exporter for Windows machines
MIT License
2.91k stars 698 forks source link

Debug Symbols / PDB needed for investigation #1032

Closed Sarkie closed 10 months ago

Sarkie commented 2 years ago

Hi,

When trying to start windows_exporter via Service or via Command Line it just hangs, nothing is logged, nothing happens.

Only thing that can be seen in ProcMon are some threads being created and sitting there.

If you could possibly provide the PDBs, then I can monitor and figure out what it is hanging on.

This is 1 server out of fleet, so we are a bit confused what it's doing as it doesn't seem to be even loading the app properly

Thanks

breed808 commented 2 years ago

Hi Sarkie, if you're looking to attach a debugger to the exporter, there is some official Golang documentation available. As mentioned in the link, Delve is a nicer debugging experience.

The only reference to PDB files I've found has been for Visual Studio; I don't believe Golang has support for creation of these files for debugging, but I'm happy to be wrong about that.

Sarkie commented 2 years ago

https://zetcode.com/golang/build/ We run the program.

$ file simple.exe simple.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows

external PDB, we should have those PDBs somewhere if you are building with debugging enabled, to enable the symbols afaik

Sarkie commented 2 years ago

@breed808 Based on the stack trace, you are connecting to WMI before you are logging anything, is this right? Or is just loading the fastprox.dll because you are importing it?

breed808 commented 2 years ago

external PDB, we should have those PDBs somewhere if you are building with debugging enabled, to enable the symbols afaik

I've only been able to find aged sources for this, but it appears that Go doesn't provide debugging symbols for Windows builds. Diving into these answers eventually links back to the official Go documentation, which only mentions Windows in passing with Delve.

Building a new Windows binary in Go seems to confirm this, as the debugging symbols are automatically stripped (or were never available).

@breed808 Based on the stack trace, you are connecting to WMI before you are logging anything, is this right? Or is just loading the fastprox.dll because you are importing it?

There are some log entries before the exporter connects to WMI.

Sarkie commented 2 years ago

So what I can see after doing an investigation, that once windows_exporter.exe connects to WMI via fastprox.dll it can hang with no input, control + c, nothing.

image

What I then managed to do after lots of trying is rebuilding the WMI seemed to the be the fix here.

Hopefully that helps and maybe add to the Wiki, but all depends on where it hangs using ProcMon

net stop winmgmt /y

winmgmt /resetrepository
github-actions[bot] commented 11 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.

gonchik commented 6 months ago

Just curios, but I see builds include some pdb info

image