How to Monitor Performances with Prometheus and WMI Exporter on Grafana Dashboard in Windows
Monitoring Performance with Prometheus and WMI Exporter on Grafana Dashboard
Required Tools for Performance Monitoring:
To monitor performance effectively, we need to install the following tools:
- WMI Exporter: WMI Exporter provides system metrics from Windows machines
- Prometheus: Prometheus handles data collection
- Grafana: Grafana creates customizable dashboards for visual analysis
These tools will allow us to collect, export, and visualize real-time performance metrics. This setup enables us to monitor, analyze, and troubleshoot system performance issues effectively.
Installing WMI Installer:
-
Download the MSI file from the GitHub repository linked below and proceed with the installation:
Windows Exporter Releases on GitHub
Download Link: windows_exporter-0.28.1-amd64.msi -
Open Windows PowerShell in administrator mode at the file location and run the following command to install the service.
windows_exporter.exe --collectors.enabled="cpu,cs,iis,logical_disk,net,os,service,system,textfile" --web.listen-address=":9182"
-
Open the Services management console and confirm that the WMI Exporter service is running on the machine.
-
Open your browser and navigate to the WMI Exporter URL:
http://localhost:9182/metrics
Installing Prometheus:
-
Download the latest version of Prometheus using the link below:
Prometheus Downloads
Download Link: prometheus-2.53.2.windows-amd64.zip
-
Extract the zip file, then open Windows PowerShell in the extracted directory to proceed with the setup.
-
Edit the prometheus.yml file to include the WMI Exporter URL for proper monitoring configuration:
- targets: ["localhost:9090", "localhost:9182"]
-
Run the following command to execute the application and start its processes:
.\prometheus.exe --config.file=prometheus.yml
-
In your browser, navigate to the URL below. Click on Status and then Targets to verify that all endpoints are up and running:
http://localhost:9090/
Installing Grafana:
-
Download the Grafana installer from the link below and run it to complete the setup:
Grafana Download Page
Direct Download Link: grafana-enterprise-11.2.0.windows-amd64.msi
-
Install the application and verify that the service is running correctly.
-
Open your browser and go to the following URL to access Grafana:
http://localhost:3000
The default credentials for Grafana are username: admin and password: admin
-
Click on Data Sources under Connections, then select Add New Data Source.
-
Locate Prometheus in the list and click on it to select the data source.
-
Enter http://localhost:9090 in the Prometheus server URL field, then click Save & Test to verify the connection.
-
Click on Home and then select Import Dashboard to add a new dashboard.
-
Select Add Visualization to perform a query to get the performance metrics of the sites in IIS.
-
Select Prometheus in the data source section.
-
Now you can run the query in code mode to get the performance metrics of the sites hosted in IIS.
Example Query: windows_iis_current_connections{site=“BoldReports_EnterpriseReporting”}
-
You can save the dashboard by providing a name for it.