Hi All,
I'm running wmi_exporter in the host to get VM metrics, now I'm wondering if I could deploy the wmi_exporter to the containers running in the host to get specific metrics of each container.
I was able to deploy the exporter and get the metrics, some of them report the same value as the VM, i.e. wmi_system_system_up_time (which I was able to get around using "wmi_process_start_time" for System process to get the uptime for each container), some of them are container specific like wmi_cpu_time_total.
I'm trying to get the RAM in use for each of the containers, but the metrics reported by each of the containers are very similar to the ones reported by the VM.
Have you tried something like this in containers? do you have any suggestion?
Any information on this is appreciated.
Thanks!
Luis
Hi @LuisLoranca,
I haven't had the opportunity to experiment with wmi_exporter in a container environment yet, but it's on my mental todo-list. Nice to see someone else trying it out!
How are you deploying the exporter into your containers, and what base image are you using? Also, what type of container are you running, "normal" Windows Server Containers or Hyper-V Isolated ones?
What we can do in these scenarios will depend quite a lot on what WMI itself does. As you mention, a lot of the classes are probably just showing you the host's data. Perhaps there is some new classes that expose the container-specific data?
I don't know if it makes sense to put any effort into finding new ways to track container stats on windows. There are plenty of options to do this:
Docker stat will give you the basic stats about each containerYou will also get nice Grafana dashboards for 2 + 3.
Docker statwill give you the basic stats about each container
This is great, but only works for the Docker host -- it can't be hooked into Prometheus easily. Perhaps something like https://github.com/projectaur/docker-stats-exporter could help there, but it doesn't appear to have any Windows testing yet (and the dependecy list isn't exactly trivial, especially for deploying to Windows).
Edit: https://github.com/infinityworks/moby-container-stats looks pretty promising as an alternative that's easier to compile into a single .exe
- Docker offers native prometheus support, but you will have to enable it in your daemon.json and it is still Experimental
The metrics Docker provides natively are currently good, but they don't provide a lot of the more interesting metrics like per-container CPU, memory, etc (which is why cAdvisor is still a better option for folks looking to monitor containers on Linux).
- googe/cadvisor will get you anything there is to know about your docker host
cAdvisor doesn't work on Windows, since it operates at a very low-level, collecting metrics directly from Linux cgroups (https://github.com/google/cadvisor/issues/1394).
:disappointed:
I created https://github.com/alexvaut/cStatsExporter to have windows containers metrics like cadvisor does on linux but on windows, It's quite handy...
@alexvaut dude-- thanks for that repo. It is quite handy! Great work.
Most helpful comment
I created https://github.com/alexvaut/cStatsExporter to have windows containers metrics like cadvisor does on linux but on windows, It's quite handy...