I'm writing a program to monitor web application performance, mostly CPU use and break down per application pool / site.
Using Microsoft.Web.Administration
I've been able to get a list of application pools, the worker processes, the process IDs and processes with a performance counter to measure those.
However, the IIS w3wp.exe
processes created by the app pools aren't the actual executing code when using .NET Core and kestrel as the actual web server.
Obviously, I could hard code / config file a bunch of process names and setup a performance monitor on those however a) this doesn't allow for any dynamic updates and b) doesn't tie back to a specific site or app pool.
I've been unable to find the link between the IIS site and the Kestrel server running for that site - I can get the web.config
and then the process path from there, which will but only if the apps have the different names, as we can't get a process ID from this?
Is there a Microsoft.Web.Administration
type system for Kestrel?