This topic describes how to install and configure Windows Exporter in an ECS instance monitored by Alibaba Cloud Managed Service for Prometheus.

Step 1: Install Windows Exporter

  1. Log on to the Windows ECS instance as an administrator.
  2. Download the Windows Exporter package to the ECS instance.
  3. Double-click the installation package windows_exporter-1.19.0-amd64.msi downloaded in the previous step, or run the msiexec /i windows_exporter-1.19.0-amd64.msi command to install Windows Exporter.
    • By default, Windows Exporter is installed in the C:\windows_exporter directory. You cannot use another directory instead.
    • The default listening port is 9182.
    • By default, the following metrics are collected: cpu, cpu_info, memory, process, tcp, cs, logical_disk, net, os, system, textfile, and time.
    After Windows Exporter is installed, you can see the created services in the Windows Services console, including Windows Exporter.
  4. Check whether Windows Exporter is working as expected. Run the curl localhost:{Listening port}/metrics command or access localhost:{Listening port}/metrics from a browser to check whether normal Prometheus metric data is returned. If normal metric data is returned, Windows Exporter is working as expected.

    Listening port: Replace the value with the actual JMX listening port.

Step 2: Configure Windows Exporter

You can modify the Config configuration file based on your business requirements. For example, you can modify the port, or add or delete monitoring items. For more information, see Windows Exporter documentation. After you modify the Config file, you must run the sc stop windows_exporter && sc start windows_exporter command or use the Windows Services console to restart Exporter Service.

Step 3: Configure tags for the ECS instance

Managed Service for Prometheus can use tags to identify ECS instances to implement service discovery. Therefore, you need to attach tags in the format of {custom tag key}:{ custom tag value} to the Windows ECS instances. Example: ecs_os:windows. If you have attached tags to your Windows ECS instances, you can skip this step. Managed Service for Prometheus

What to do next

After you configure Windows Exporter, you can add Windows Exporter in the Managed Service for Prometheus console and view the monitoring data. For more information, see Use Managed Service for Prometheus to monitor Windows OSs.