Prometheus on Windows
For monitoring Windows with Prometheus, a Windows exporter needs to be installed which is the equivalent of Node exporter for Windows. This exporter will start an HTTP endpoint, exposing metrics that will enable Prometheus to scrape them.
Windows exporter (node) installation:
You can run the latest MSI installer from the below link, each release provides a .msi installer. The installer will set up the windows_exporter as a Windows service, as well as create an exception in the Windows Firewall. Node-exporter will be run on port 9182 by default after the installation.
Prometheus installation:
Please follow the below steps to install Prometheus on Windows:
Download the prometheus.ps1 file
Powershell by default uses TLS 1.0 to connect to the website, but website security requires TLS 1.2, hence run the below.
By default, Windows does not allow you to execute any scripts due to the execution policy set, to enable it, run the below
Execute the below script, the script will download and install Prometheus as a service in the path where the script is executed.
You should see Prometheus running, run the below to check
If you want to add/ modify to enable Prometheus to scrape custom endpoint (ex: windows-exporter), make the changes on prometheus.yml file in the Prometheus directory downloaded by the script above and restart the Prometheus service
To enable remote-write on Prometheus, include the remote-write endpoint as shown below in the Prometheus.yml configuration and restart the Prometheus service.
Last updated