Menu

Caution

Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Open source

prometheus.exporter.windows

The prometheus.exporter.windows component embeds windows_exporter which exposes a wide variety of hardware and OS metrics for Windows-based systems.

The windows_exporter itself comprises various collectors, which can be enabled and disabled at will. For more information on collectors, refer to the collectors-list section.

Usage

river
prometheus.exporter.windows "LABEL" { 
}

Arguments

The following arguments can be used to configure the exporter’s behavior. All arguments are optional. Omitted fields take their default values.

NameTypeDescriptionDefaultRequired
enabled_collectorslist(string)List of collectors to enable.["cpu","cs","logical_disk","net","os","service","system"]no
timeoutdurationConfigure timeout for collecting metrics.4mno

enabled_collectors defines a hand-picked list of enabled-by-default collectors. If set, anything not provided in that list is disabled by default. See the Collectors list for the default set.

Blocks

The following blocks are supported inside the definition of prometheus.exporter.windows to configure collector-specific options:

HierarchyNameDescriptionRequired
dfsrdfsrConfigures the dfsr collector.no
exchangeexchangeConfigures the exchange collector.no
iisiisConfigures the iis collector.no
logical_disklogical_diskConfigures the logical_disk collector.no
msmqmsmqConfigures the msmq collector.no
mssqlmssqlConfigures the mssql collector.no
networknetworkConfigures the network collector.no
processprocessConfigures the process collector.no
scheduled_task[scheduled_task][]Configures the scheduled_task collector.no
serviceserviceConfigures the service collector.no
smtpsmtpConfigures the smtp collector.no
text_filetext_fileConfigures the text_file collector.no

dfsr block

NameTypeDescriptionDefaultRequired
source_enabledlist(string)Comma-separated list of DFSR Perflib sources to use.["connection","folder","volume"]no

exchange block

NameTypeDescriptionDefaultRequired
enabled_liststringComma-separated list of collectors to use.""no

The collectors specified by enabled_list can include the following:

  • ADAccessProcesses
  • TransportQueues
  • HttpProxy
  • ActiveSync
  • AvailabilityService
  • OutlookWebAccess
  • Autodiscover
  • WorkloadManagement
  • RpcClientAccess

For example, enabled_list may be set to "AvailabilityService,OutlookWebAccess".

iis block

NameTypeDescriptionDefaultRequired
app_blackliststringRegular expression of applications to ignore.no
app_whiteliststringRegular expression of applications to report on.no
site_blackliststringRegular expression of sites to ignore.no
site_whiteliststringRegular expression of sites to report on.no

text_file block

NameTypeDescriptionDefaultRequired
text_file_directorystringThe directory containing the files to be ingested.C:\Program Files\windows_exporter\textfile_inputsno

When text_file_directory is set, only files with the extension .prom inside the specified directory are read. Each .prom file found must end with an empty line feed to work properly.

smtp block

NameTypeDescriptionDefaultRequired
blackliststringRegexp of virtual servers to ignore.no
whiteliststringRegexp of virtual servers to include.".+"no

For a server name to be included, it must match the regular expression specified by whitelist and must not match the regular expression specified by blacklist.

service block

NameTypeDescriptionDefaultRequired
where_clausestringWQL ‘where’ clause to use in WMI metrics query.no

The where_clause argument can be used to limit the response to the services you specify, reducing the size of the response.

process block

NameTypeDescriptionDefaultRequired
blackliststringRegular expression of processes to exclude.no
whiteliststringRegular expression of processes to include.".*"no

Processes must match the regular expression specified by whitelist and must not match the regular expression specified by blacklist to be included.

network block

NameTypeDescriptionDefaultRequired
blackliststringRegular expression of NIC:s to exclude.no
whiteliststringRegular expression of NIC:s to include.".*"no

NIC names must match the regular expression specified by whitelist and must not match the regular expression specified by blacklist to be included.

mssql block

NameTypeDescriptionDefaultRequired
enabled_classeslist(string)Comma-separated list of MSSQL WMI classes to use.["accessmethods", "availreplica", "bufman", "databases", "dbreplica", "genstats", "locks", "memmgr", "sqlstats", "sqlerrorstransactions"]no

msmq block

NameTypeDescriptionDefaultRequired
where_clausestringWQL ‘where’ clause to use in WMI metrics query.no

Specifying enabled_classes is useful to limit the response to the MSMQs you specify, reducing the size of the response.

logical_disk block

NameTypeDescriptionDefaultRequired
blackliststringRegular expression of volumes to exclude.no
whiteliststringRegular expression of volumes to include.".+"no

Volume names must match the regular expression specified by whitelist and must not match the regular expression specified by blacklist to be included.

Exported fields

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

NameTypeDescription
targetslist(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 will use the configured in-memory traffic address specified by the run command.

Component health

prometheus.exporter.windows is only reported as unhealthy if given an invalid configuration. In those cases, exported fields retain their last healthy values.

Debug information

prometheus.exporter.windows does not expose any component-specific debug information.

Debug metrics

prometheus.exporter.windows does not expose any component-specific debug metrics.

Collectors list

The following table lists the available collectors that windows_exporter brings bundled in. Some collectors only work on specific operating systems; enabling a collector that is not supported by the host OS where Flow is running is a no-op.

Users can choose to enable a subset of collectors to limit the amount of metrics exposed by the prometheus.exporter.windows component, or disable collectors that are expensive to run.

NameDescriptionEnabled by default
adActive Directory Domain Services
adfsActive Directory Federation Services
cacheCache metrics
cpuCPU usage
cpu_infoCPU Information
cs“Computer System” metrics (system properties, num cpus/total memory)
containerContainer metrics
dfsrDFSR metrics
dhcpDHCP Server
dnsDNS Server
exchangeExchange metrics
fsrmquotaMicrosoft File Server Resource Manager (FSRM) Quotas collector
hypervHyper-V hosts
iisIIS sites and applications
logical_diskLogical disks, disk I/O
logonUser logon sessions
memoryMemory usage metrics
msmqMSMQ queues
mssqlSQL Server Performance Objects metrics
netframework_clrexceptions.NET Framework CLR Exceptions
netframework_clrinterop.NET Framework Interop Metrics
netframework_clrjit.NET Framework JIT metrics
netframework_clrloading.NET Framework CLR Loading metrics
netframework_clrlocksandthreads.NET Framework locks and metrics threads
netframework_clrmemory.NET Framework Memory metrics
netframework_clrremoting.NET Framework Remoting metrics
netframework_clrsecurity.NET Framework Security Check metrics
netNetwork interface I/O
osOS metrics (memory, processes, users)
processPer-process metrics
remote_fxRemoteFX protocol (RDP) metrics
serviceService state metrics
smtpIIS SMTP Server
systemSystem calls
tcpTCP connections
timeWindows Time Service
thermalzoneThermal information
terminal_servicesTerminal services (RDS)
textfileRead prometheus metrics from a text file
vmwarePerformance counters installed by the Vmware Guest agent

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

Example

This example uses a prometheus.scrape component to collect metrics from prometheus.exporter.windows:

river
prometheus.exporter.windows "default" {
}

// Configure a prometheus.scrape component to collect windows metrics.
prometheus.scrape "example" {
  targets    = prometheus.exporter.windows.this.targets
  forward_to = [ /* ... */ ]
}