---
title: "prometheus.exporter.windows | Grafana Alloy documentation"
description: "Learn about prometheus.exporter.windows"
---

# `prometheus.exporter.windows`

The `prometheus.exporter.windows` component embeds the [`windows_exporter`](https://github.com/prometheus-community/windows_exporter/tree/v0.31.3) which exposes a wide variety of hardware and OS metrics for Windows-based systems.

The `windows_exporter` itself comprises various *collectors*, which you can enable and disable as needed. For more information on collectors, refer to the [`collectors-list`](#collectors-list) section.

> Note
> 
> The `blacklist` and `whitelist` configuration arguments are deprecated but remain available for backwards compatibility. Use the `include` and `exclude` arguments instead.

> Note
> 
> We do not recommend using this exporter with [clustering](../../../../get-started/clustering/) enabled.
> 
> The default `instance` label set by this exporter is the hostname of the machine running Alloy. Alloy clustering uses consistent hashing to distribute targets across the instances. This requires the discovered targets to be the same and have the same labels across all cluster instances.
> 
> If you do need to use this component in a cluster, use a dedicated `prometheus.scrape` component that’s used to scrape this exporter and doesn’t have clustering enabled. Alternatively, use `discovery.relabel` to set the `instance` label to a value that is the same across all cluster instances.

## Usage

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
prometheus.exporter.windows "<LABEL>" {
}
```

## Arguments

You can use the following arguments with `prometheus.exporter.windows`:

Expand table

| Name                 | Type           | Description                   | Default                                                | Required |
|----------------------|----------------|-------------------------------|--------------------------------------------------------|----------|
| `enabled_collectors` | `list(string)` | List of collectors to enable. | `["cpu","logical_disk","net","os","service","system"]` | no       |

`enabled_collectors` defines a hand-picked list of collectors to enable by default. If you set this argument, the component disables any collectors not in the list. Refer to the [Collectors list](#collectors-list) for the default set.

> Caution
> 
> To use any of the configuration blocks below, you must add the corresponding collector name to the `enabled_collectors` list. For example, to use the `dns` block, you must include `"dns"` in your `enabled_collectors` list. A block has no effect unless you enable its collector.

## Blocks

You can use the following blocks with `prometheus.exporter.windows`. Each block only takes effect if you include its corresponding collector in `enabled_collectors`.

No valid configuration blocks found.

> Caution
> 
> The `text_file` block is deprecated as of Alloy v1.11.0. Use the `textfile` block to configure the `textfile` collector.

> Note
> 
> The `msmq` block is deprecated as of Alloy v1.9.0. You can still include this block in your configuration files, but it has no effect.

### `dfsr`

Expand table

| Name              | Type           | Description                              | Default                            | Required |
|-------------------|----------------|------------------------------------------|------------------------------------|----------|
| `sources_enabled` | `list(string)` | A list of DFSR `Perflib` sources to use. | `["connection","folder","volume"]` | no       |

### `dns`

Expand table

| Name           | Type           | Description                  | Default                    | Required |
|----------------|----------------|------------------------------|----------------------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use. | `["metrics", "wmi_stats"]` | no       |

### `exchange`

Expand table

| Name           | Type           | Description                  | Default                                                                                                                                                                                     | Required |
|----------------|----------------|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use. | `["ADAccessProcesses", "TransportQueues", "HttpProxy", "ActiveSync", "AvailabilityService", "OutlookWebAccess", "Autodiscover", "WorkloadManagement", "RpcClientAccess", "MapiHttpEmsmdb"]` | no       |

### `filetime`

Expand table

| Name            | Type           | Description                                          | Default | Required |
|-----------------|----------------|------------------------------------------------------|---------|----------|
| `file_patterns` | `list(string)` | A list of glob patterns that match files to monitor. | `[]`    | no       |

### `iis`

Expand table

| Name           | Type     | Description                                      | Default  | Required |
|----------------|----------|--------------------------------------------------|----------|----------|
| `app_exclude`  | `string` | Regular expression of applications to ignore.    | `"^$"`   | no       |
| `app_include`  | `string` | Regular expression of applications to report on. | `"^.+$"` | no       |
| `site_exclude` | `string` | Regular expression of sites to ignore.           | `"^$"`   | no       |
| `site_include` | `string` | Regular expression of sites to report on.        | `"^.+$"` | no       |

The component [wraps](#wrap-regular-expression-strings) user-supplied `app_exclude`, `app_include`, `site_exclude`, and `site_include` strings in a regular expression.

### `logical_disk`

Expand table

| Name           | Type           | Description                               | Default       | Required |
|----------------|----------------|-------------------------------------------|---------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use.              | `["metrics"]` | no       |
| `exclude`      | `string`       | Regular expression of volumes to exclude. | `"^$"`        | no       |
| `include`      | `string`       | Regular expression of volumes to include. | `"^.+$"`      | no       |

The collectors specified by `enabled_list` can include the following:

- `metrics`
- `bitlocker_status`

The component includes volume names that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `mscluster`

Expand table

| Name           | Type           | Description                  | Default                                                   | Required |
|----------------|----------------|------------------------------|-----------------------------------------------------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use. | `["cluster","network","node","resource","resourcegroup"]` | no       |

The collectors specified by `enabled_list` can include the following:

- `cluster`
- `network`
- `node`
- `resource`
- `resourcegroup`

For example, you can set `enabled_list` to `["cluster"]`.

### `mssql`

Expand table

| Name              | Type           | Description                         | Default                                                                                                                                                              | Required |
|-------------------|----------------|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| `enabled_classes` | `list(string)` | A list of MSSQL WMI classes to use. | `["accessmethods", "availreplica", "bufman", "databases", "dbreplica", "genstats", "info", "locks", "memmgr", "sqlerrors", "sqlstats", "transactions", "waitstats"]` | no       |

### `net`

Expand table

| Name           | Type           | Description                            | Default                   | Required |
|----------------|----------------|----------------------------------------|---------------------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use.           | `["metrics", "nic_info"]` | no       |
| `exclude`      | `string`       | Regular expression of NICs to exclude. | `"^$"`                    | no       |
| `include`      | `string`       | Regular expression of NICs to include. | `"^.+$"`                  | no       |

The collectors specified by `enabled_list` can include the following:

- `metrics`
- `nic_info`

The component includes NIC names that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `network`

Expand table

| Name      | Type     | Description                            | Default  | Required |
|-----------|----------|----------------------------------------|----------|----------|
| `exclude` | `string` | Regular expression of NICs to exclude. | `"^$"`   | no       |
| `include` | `string` | Regular expression of NICs to include. | `"^.+$"` | no       |

The component includes NIC names that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `netframework`

Expand table

| Name           | Type           | Description                  | Default                                                                                                             | Required |
|----------------|----------------|------------------------------|---------------------------------------------------------------------------------------------------------------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use. | `["clrexceptions","clrinterop","clrjit","clrloading","clrlocksandthreads","clrmemory","clrremoting","clrsecurity"]` | no       |

The collectors specified by `enabled_list` can include the following:

- `clrexceptions`
- `clrinterop`
- `clrjit`
- `clrloading`
- `clrlocksandthreads`
- `clrmemory`
- `clrremoting`
- `clrsecurity`

For example, you can set `enabled_list` to `["clrjit"]`.

### `performancecounter`

Expand table

| Name      | Type     | Description                                       | Default | Required |
|-----------|----------|---------------------------------------------------|---------|----------|
| `objects` | `string` | YAML string representing the counters to monitor. | `""`    | no       |

The `objects` field accepts a YAML string that satisfies the schema in the exporter’s [documentation](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.performancecounter.md) for the `performancecounter` collector. You can construct this directly in Alloy syntax with [raw Alloy syntax strings](../../../../get-started/configuration-syntax/expressions/types_and_values/#raw-strings), but the best way to configure this collector is to use a `local.file` component.

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
local.file "counters" {
  filename = "/etc/alloy/performance_counters.yaml"
}

prometheus.exporter.windows "default" {
  ...

  performancecounter {
    objects = local.file.counters.content
  }

  ...
}
```

The `performance_counters.yaml` file should be a YAML file that represents an array of objects matching the schema in the documentation, like the example below.

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
# Monitor Memory performance counters
- name: memory
  object: "Memory"
  counters:
    - name: "Cache Faults/sec"
      type: "counter"  # Use 'counter' for cumulative/rate metrics
    - name: "Available Bytes"
      type: "gauge"    # Use 'gauge' for point-in-time values

# Monitor Processor performance counters
- name: processor
  object: "Processor"
  instances: ["_Total"]  # Optional: filter to specific instances
  counters:
    - name: "% Processor Time"
      type: "gauge"
    - name: "Interrupts/sec"
      type: "counter"
```

### `physical_disk`

Expand table

| Name      | Type     | Description                                     | Default  | Required |
|-----------|----------|-------------------------------------------------|----------|----------|
| `exclude` | `string` | Regular expression of physical disk to exclude. | `"^$"`   | no       |
| `include` | `string` | Regular expression of physical disk to include. | `"^.+$"` | no       |

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `printer`

Expand table

| Name      | Type     | Description                               | Default  | Required |
|-----------|----------|-------------------------------------------|----------|----------|
| `exclude` | `string` | Regular expression of printer to exclude. | `"^$"`   | no       |
| `include` | `string` | Regular expression of printer to include. | `"^.+$"` | no       |

The component includes printers that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `process`

Expand table

| Name                        | Type     | Description                                 | Default  | Required |
|-----------------------------|----------|---------------------------------------------|----------|----------|
| `counter_version`           | `int`    | Version of the process collector to use.    | `0`      | no       |
| `enable_iis_worker_process` | `bool`   | Enable IIS worker process name queries.     | `false`  | no       |
| `exclude`                   | `string` | Regular expression of processes to exclude. | `"^$"`   | no       |
| `include`                   | `string` | Regular expression of processes to include. | `"^.+$"` | no       |

The `counter_version` may be `0`, `1`, or `2`.

- A value of `1` uses the Windows `Process` performance counters through the [registry](https://learn.microsoft.com/en-us/windows/win32/perfctrs/using-the-registry-functions-to-consume-counter-data) API.
- A value of `2` uses the Windows `Process V2` performance counters through the [Performance Data Helper (PDH)](https://learn.microsoft.com/en-us/windows/win32/perfctrs/collecting-performance-data) API. These counters are available starting in Windows 11.
- A value of `0` checks if `Process V2` counters are available and falls back to `Process` counters if they aren’t.

The component includes processes that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

The upstream collector warns that `enable_iis_worker_process` may leak memory. Use with caution.

### `scheduled_task`

Expand table

| Name      | Type     | Description                             | Default  | Required |
|-----------|----------|-----------------------------------------|----------|----------|
| `exclude` | `string` | Regular expression of tasks to exclude. | `"^$"`   | no       |
| `include` | `string` | Regular expression of tasks to include. | `"^.+$"` | no       |

The component includes tasks that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `service`

Expand table

| Name      | Type     | Description                                | Default  | Required |
|-----------|----------|--------------------------------------------|----------|----------|
| `exclude` | `string` | Regular expression of services to exclude. | `"^$"`   | no       |
| `include` | `string` | Regular expression of services to include. | `"^.+$"` | no       |

The component includes services that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

> Note
> 
> The `use_api`, `where_clause`, and `enable_v2_collector` attributes are deprecated as of Alloy v1.9.0. You can still include these attributes in your configuration files, but they have no effect.

### `smb`

Expand table

| Name           | Type           | Description                                      | Default | Required |
|----------------|----------------|--------------------------------------------------|---------|----------|
| `enabled_list` | `list(string)` | Deprecated (no-op), a list of collectors to use. | `[]`    | no       |

The collectors specified by `enabled_list` can include the following:

- `ServerShares`

For example, you can set `enabled_list` to `["ServerShares"]`.

### `smb_client`

Expand table

| Name           | Type           | Description                                      | Default | Required |
|----------------|----------------|--------------------------------------------------|---------|----------|
| `enabled_list` | `list(string)` | Deprecated (no-op), a list of collectors to use. | `[]`    | no       |

The collectors specified by `enabled_list` can include the following:

- `ClientShares`

For example, you can set `enabled_list` to `["ClientShares"]`.

### `smtp`

Expand table

| Name      | Type     | Description                                       | Default  | Required |
|-----------|----------|---------------------------------------------------|----------|----------|
| `exclude` | `string` | Regular expression of virtual servers to ignore.  | `"^$"`   | no       |
| `include` | `string` | Regular expression of virtual servers to include. | `"^.+$"` | no       |

The component includes server names that match the regular expression specified by `include` and don’t match the regular expression specified by `exclude`.

The component [wraps](#wrap-regular-expression-strings) user-supplied `exclude` and `include` strings in a regular expression.

### `tcp`

Expand table

| Name           | Type           | Description                  | Default                           | Required |
|----------------|----------------|------------------------------|-----------------------------------|----------|
| `enabled_list` | `list(string)` | A list of collectors to use. | `["metrics","connections_state"]` | no       |

The collectors specified by `enabled_list` can include the following:

- `connections_state`
- `metrics`

For example, you can set `enabled_list` to `["metrics"]`.

### `textfile`

Expand table

| Name                  | Type           | Description                                           | Default     | Required |
|-----------------------|----------------|-------------------------------------------------------|-------------|----------|
| `directories`         | `list(string)` | The list of directories containing files to ingest.   | *see below* | no       |
| `text_file_directory` | `string`       | Deprecated. The directory containing files to ingest. |             | no       |

By default, `directories` contains the `textfile_inputs` directory in the Alloy installation directory. For example, if you install Alloy in `C:\Program Files\GrafanaLabs\Alloy\`, the default is `["C:\Program Files\GrafanaLabs\Alloy\textfile_inputs"]`.

The deprecated `text_file_directory` attribute accepts a comma-separated string of directories. If you set both `text_file_directory` and `directories`, the component combines them into a single list.

For backwards compatibility, you can also use the deprecated `text_file` block to configure the `textfile` collector. If you configure both blocks, the component combines the distinct directory values from each.

The component only reads files with the `.prom` extension inside the specified directories.

> Note
> 
> The `.prom` files must end with an empty line feed for the component to recognize and read them.

### `text_file` (Deprecated: use `textfile` instead)

Expand table

| Name                  | Type           | Description                                           | Default     | Required |
|-----------------------|----------------|-------------------------------------------------------|-------------|----------|
| `directories`         | `list(string)` | The list of directories containing files to ingest.   | *see below* | no       |
| `text_file_directory` | `string`       | Deprecated. The directory containing files to ingest. |             | no       |

This block is deprecated. Use the `textfile` block instead.

By default, `directories` contains the `textfile_inputs` directory in the Alloy installation directory. For example, if you install Alloy in `C:\Program Files\GrafanaLabs\Alloy\`, the default is `["C:\Program Files\GrafanaLabs\Alloy\textfile_inputs"]`.

The deprecated `text_file_directory` attribute accepts a comma-separated string of directories. If you set both `text_file_directory` and `directories`, the component combines them into a single list.

If you configure both `text_file` and `textfile` blocks, the component combines the distinct directory values from each.

The component only reads files with the `.prom` extension inside the specified directories.

> Note
> 
> The `.prom` files must end with an empty line feed for the component to recognize and read them.

### `update`

Expand table

| Name              | Type       | Description                                          | Default | Required |
|-------------------|------------|------------------------------------------------------|---------|----------|
| `online`          | `bool`     | Whether to search for updates online.                | `false` | no       |
| `scrape_interval` | `duration` | How frequently to scrape Windows Update information. | `6h`    | no       |

## Exported fields

The following fields are exported and can be referenced by other components.

Expand table

| Name      | Type                | Description                                               |
|-----------|---------------------|-----------------------------------------------------------|
| `targets` | `list(map(string))` | The targets that can be used to collect exporter metrics. |

For example, the `targets` can either be passed to a `discovery.relabel` component to rewrite the targets’ label sets or to a `prometheus.scrape` component that collects the exposed metrics.

The exported targets use the configured [in-memory traffic](../../../../get-started/component_controller/#in-memory-traffic) address specified by the [run command](../../../cli/run/).

## Component health

`prometheus.exporter.windows` reports as unhealthy only when you provide an invalid configuration. In those cases, exported fields retain their last healthy values.

## Debug information

`prometheus.exporter.windows` doesn’t expose any component-specific debug information.

## Debug metrics

`prometheus.exporter.windows` doesn’t expose any component-specific debug metrics.

## Wrap regular expression strings

Some collector blocks such as [`scheduled_task`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.scheduled_task.md) accept a regular expression as a string argument. `prometheus.exporter.windows` prefixes some regular expression string arguments with `^(?:` and suffixes them with `)$`. For example, if a user sets an `exclude` argument to `".*"`, Alloy sets it to `"^(?:.*)$"`.

To find out if the component wraps a particular regular expression argument, refer to the collector block documentation.

> Note
> 
> The wrapping may change the behaviour of your regular expression. For example, the `e.*` regular expression would normally match both the “service” and “email” strings. However, `^(?:e.*)$` would only match “email”.

## Collectors list

The following table lists the available collectors in `windows_exporter`. Some collectors only work on specific operating systems. If you enable a collector that the host OS doesn’t support, it has no effect.

You can enable a subset of collectors to limit the amount of metrics that the `prometheus.exporter.windows` component exposes, or disable collectors that are expensive to run.

Expand table

| Name                                                                                                                               | Description                                                                                                                                                 | Enabled by default |
|------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| [`ad`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.ad.md)                                 | Active Directory Domain Services                                                                                                                            |                    |
| [`adcs`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.adcs.md)                             | Active Directory Certificate Services                                                                                                                       |                    |
| [`adfs`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.adfs.md)                             | Active Directory Federation Services                                                                                                                        |                    |
| [`cache`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.cache.md)                           | Cache metrics                                                                                                                                               |                    |
| [`cpu`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.cpu.md)                               | CPU usage                                                                                                                                                   | Yes                |
| [`cpu_info`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.cpu_info.md)                     | CPU Information                                                                                                                                             |                    |
| [`container`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.container.md)                   | Container metrics                                                                                                                                           |                    |
| [`dfsr`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.dfsr.md)                             | DFSR metrics                                                                                                                                                |                    |
| [`dhcp`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.dhcp.md)                             | DHCP Server                                                                                                                                                 |                    |
| [`dns`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.dns.md)                               | DNS Server                                                                                                                                                  |                    |
| [`exchange`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.exchange.md)                     | Exchange metrics                                                                                                                                            |                    |
| [`filetime`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.filetime.md)                     | File modification time metrics                                                                                                                              |                    |
| [`fsrmquota`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.fsrmquota.md)                   | Microsoft File Server Resource Manager (FSRM) Quotas collector                                                                                              |                    |
| [`gpu`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.gpu.md)                               | GPU usage and memory consumption                                                                                                                            |                    |
| [`hyperv`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.hyperv.md)                         | Hyper-V hosts                                                                                                                                               |                    |
| [`iis`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.iis.md)                               | IIS sites and applications                                                                                                                                  |                    |
| [`logical_disk`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.logical_disk.md)             | Logical disks, disk I/O                                                                                                                                     | Yes                |
| [`memory`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.memory.md)                         | Memory usage metrics                                                                                                                                        |                    |
| [`mscluster`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.mscluster.md)                   | MSCluster metrics                                                                                                                                           |                    |
| [`msmq`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.msmq.md)                             | MSMQ queues                                                                                                                                                 |                    |
| [`mssql`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.mssql.md)                           | [SQL Server Performance Objects](https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects#SQLServerPOs) metrics |                    |
| [`netframework`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.netframework.md)             | .NET Framework metrics                                                                                                                                      |                    |
| [`net`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.net.md)                               | Network interface I/O                                                                                                                                       | Yes                |
| [`os`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.os.md)                                 | OS metrics (memory, processes, users)                                                                                                                       | Yes                |
| [`pagefile`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.pagefile.md)                     | Pagefile metrics                                                                                                                                            |                    |
| [`performancecounter`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.performancecounter.md) | Performance Counter metrics                                                                                                                                 |                    |
| [`physical_disk`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.physical_disk.md)           | Physical disks                                                                                                                                              |                    |
| [`printer`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.printer.md)                       | Printer metrics                                                                                                                                             |                    |
| [`process`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.process.md)                       | Per-process metrics                                                                                                                                         |                    |
| [`remote_fx`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.remote_fx.md)                   | RemoteFX protocol (RDP) metrics                                                                                                                             |                    |
| [`scheduled_task`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.scheduled_task.md)         | Scheduled Tasks metrics                                                                                                                                     |                    |
| [`service`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.service.md)                       | Service state metrics                                                                                                                                       | Yes                |
| [`smb`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.smb.md)                               | SMB Server shares                                                                                                                                           |                    |
| [`smb_client`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.smbclient.md)                  | SMB Client shares                                                                                                                                           |                    |
| [`smtp`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.smtp.md)                             | IIS SMTP Server                                                                                                                                             |                    |
| [`system`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.system.md)                         | System calls                                                                                                                                                | Yes                |
| [`tcp`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.tcp.md)                               | TCP connections                                                                                                                                             |                    |
| [`time`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.time.md)                             | Windows Time Service                                                                                                                                        |                    |
| [`thermalzone`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.thermalzone.md)               | Thermal information                                                                                                                                         |                    |
| [`terminal_services`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.terminal_services.md)   | Terminal services (RDS)                                                                                                                                     |                    |
| [`textfile`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.textfile.md)                     | Read Prometheus metrics from a text file                                                                                                                    |                    |
| [`udp`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.udp.md)                               | UDP connections                                                                                                                                             |                    |
| [`update`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.update.md)                         | Windows Update service metrics                                                                                                                              |                    |
| [`vmware`](https://github.com/prometheus-community/windows_exporter/blob/v0.31.3/docs/collector.vmware.md)                         | Performance counters installed by the VMware Guest agent                                                                                                    |                    |

Refer to the linked documentation on each collector for more information on reported metrics, configuration settings and usage examples.

> Caution
> 
> Certain collectors cause Alloy to crash if you use them without the required infrastructure. These include but aren’t limited to `mscluster`, `VMware`, `nps`, `dns`, `msmq`, `ad`, `hyperv`, and `scheduled_task`.
> 
> The `cs` and `logon` collectors are deprecated and removed from the exporter. You can still configure these collectors, but they have no effect.

## Example

The following example uses a [`prometheus.scrape`](../prometheus.scrape/) component to collect metrics from `prometheus.exporter.windows`:

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
prometheus.exporter.windows "default" { }

// Configure a prometheus.scrape component to collect windows metrics.
prometheus.scrape "example" {
  targets    = prometheus.exporter.windows.default.targets
  forward_to = [prometheus.remote_write.demo.receiver]
}

prometheus.remote_write "demo" {
  endpoint {
    url = "<PROMETHEUS_REMOTE_WRITE_URL>"

    basic_auth {
      username = "<USERNAME>"
      password = "<PASSWORD>"
    }
  }
}
```

The following example shows you how to enable additional collectors and configure them:

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
prometheus.exporter.windows "advanced" {
  // Enable additional collectors beyond the default set
  enabled_collectors = [
    "cpu", "logical_disk", "net", "os", "service", "system",  // defaults
    "dns", "iis", "process", "scheduled_task"                 // additional
  ]

  // Configure DNS collector settings
  dns {
    enabled_list = ["metrics", "wmi_stats"]
  }

  // Configure IIS collector settings
  iis {
    site_include = "^(Default Web Site|Production)$"
    app_exclude  = "^$"
  }

  // Configure process collector settings
  process {
    include = "^(chrome|firefox|notepad).*"
    exclude = "^$"
  }
}

prometheus.scrape "advanced_example" {
  targets    = prometheus.exporter.windows.advanced.targets
  forward_to = [prometheus.remote_write.demo.receiver]
}
```

Replace the following:

- *`<PROMETHEUS_REMOTE_WRITE_URL>`* : The URL of the Prometheus `remote_write` compatible server to send metrics to.
- *`<USERNAME>`* : The username to use for authentication to the `remote_write` API.
- *`<PASSWORD>`* : The password to use for authentication to the `remote_write` API.

## Compatible components

`prometheus.exporter.windows` has exports that can be consumed by the following components:

- Components that consume [Targets](../../../compatibility/#targets-consumers)

> Note
> 
> Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.
