<p>I have Prometheus setup for Windows containers which scrapes the metrics supported by the wmi_exporter. But I wanted some metrics that track the pod restarts, etc which are not part of that. I believe kube-state-metrics offers this functionality. But I could not find any way to install it on Windows containers. All the helm charts I found online have images that only work with Linux containers. So, is there any way to install it on Windows containers?</p>

<p>Is there any other better way to have alerts for pod/container restarts?</p>

sai guru datt manchikanti
<p>You can use <a href="https://github.com/kubernetes/kube-state-metrics" rel="nofollow noreferrer">kube-state-metrics</a> like you said. From the Kubernetes control plane point of view, a pod/container restart is no different whether you are using Linux or Windows containers.</p>

<p>Keep in mind that the <a href="https://kubernetes.io/docs/setup/windows/#control-plane" rel="nofollow noreferrer">control plane</a> is only supported on Linux so in case you only have Windows nodes on your cluster you can run the kube-state-metrics pod/container in your master(s), otherwise, you will need a Linux node. Alternatively, you can build the kube-state-metrics Windows Go binary and run it on a Windows pod/container, but that could be more troublesome.</p>

<p>You can use something like <a href="https://stackoverflow.com/a/51245203/2989261">this</a> with <a href="https://prometheus.io/docs/alerting/alertmanager/" rel="nofollow noreferrer">Alertmanager</a> as an alert.</p>
