diff --git a/CHANGELOG.md b/CHANGELOG.md index d48cc5df9d..35e69de435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ Main (unreleased) - Fixed a bug with `loki.source.podlogs` not starting in large clusters due to short informer sync timeout. (@elburnetto-intapp) +- `prometheus.exporter.windows`: Fixed bug with `exclude` regular expression config arguments which caused missing metrics. (@ptodev) + ### Other changes - Small fix in UI stylesheet to fit more content into visible table area. (@defanator) diff --git a/docs/sources/_index.md b/docs/sources/_index.md index dab873ccee..27c845f319 100644 --- a/docs/sources/_index.md +++ b/docs/sources/_index.md @@ -6,6 +6,7 @@ weight: 350 cascade: ALLOY_RELEASE: v1.5.0 OTEL_VERSION: v0.105.0 + PROM_WIN_EXP_VERSION: v0.27.3 FULL_PRODUCT_NAME: Grafana Alloy PRODUCT_NAME: Alloy hero: diff --git a/docs/sources/_index.md.t b/docs/sources/_index.md.t index aa44e44df2..9c441111ca 100644 --- a/docs/sources/_index.md.t +++ b/docs/sources/_index.md.t @@ -6,6 +6,7 @@ weight: 350 cascade: ALLOY_RELEASE: $ALLOY_VERSION OTEL_VERSION: v0.105.0 + PROM_WIN_EXP_VERSION: v0.27.3 FULL_PRODUCT_NAME: Grafana Alloy PRODUCT_NAME: Alloy hero: diff --git a/docs/sources/reference/components/prometheus/prometheus.exporter.windows.md b/docs/sources/reference/components/prometheus/prometheus.exporter.windows.md index 4eaab37bfb..9e75737c34 100644 --- a/docs/sources/reference/components/prometheus/prometheus.exporter.windows.md +++ b/docs/sources/reference/components/prometheus/prometheus.exporter.windows.md @@ -8,17 +8,19 @@ title: prometheus.exporter.windows # prometheus.exporter.windows The `prometheus.exporter.windows` component embeds -[windows_exporter](https://github.com/prometheus-community/windows_exporter) which exposes a +[windows_exporter][] 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. {{< admonition type="note" >}} -The black and white list configuration options are available for backwards compatibility but are deprecated. -The include and exclude configuration options are preferred going forward. +The `blacklist` and `whitelist` configuration arguments arguments are available for backwards compatibility but are deprecated. +The `include` and `exclude` arguments are preferred going forward. {{< /admonition >}} +[windows_exporter]: https://github.com/prometheus-community/windows_exporter/tree/{{< param "PROM_WIN_EXP_VERSION" >}} + ## Usage ```alloy @@ -31,10 +33,9 @@ prometheus.exporter.windows "LABEL" { The following arguments can be used to configure the exporter's behavior. All arguments are optional. Omitted fields take their default values. -| Name | Type | Description | Default | Required | -|----------------------|----------------|-------------------------------------------|-------------------------------------------------------------|----------| -| `enabled_collectors` | `list(string)` | List of collectors to enable. | `["cpu","cs","logical_disk","net","os","service","system"]` | no | -| `timeout` | `duration` | Configure timeout for collecting metrics. | `4m` | no | +| Name | Type | Description | Default | Required | +|----------------------|----------------|-------------------------------|-------------------------------------------------------------|----------| +| `enabled_collectors` | `list(string)` | List of collectors to enable. | `["cpu","cs","logical_disk","net","os","service","system"]` | no | `enabled_collectors` defines a hand-picked list of enabled-by-default collectors. If set, anything not provided in that list is disabled by default. @@ -83,51 +84,38 @@ text_file | [text_file][] | Configures the text_file collector. | ### dfsr block -Name | Type | Description | Default | Required ------------------|----------------|------------------------------------------------------|------------------------------------|--------- -`source_enabled` | `list(string)` | Comma-separated list of DFSR Perflib sources to use. | `["connection","folder","volume"]` | no +Name | Type | Description | Default | Required +-----------------|----------------|----------------------------------------|------------------------------------|--------- +`source_enabled` | `list(string)` | A list of DFSR Perflib sources to use. | `["connection","folder","volume"]` | no ### exchange block -Name | Type | Description | Default | Required ----------------|----------|--------------------------------------------|---------|--------- -`enabled_list` | `string` | Comma-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"`. - +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 ### iis block -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 +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 +User-supplied `app_exclude`, `app_include`, `site_exclude` and `site_include` strings will be [wrapped][wrap-regex] in a regular expression. ### logical_disk block -Name | Type | Description | Default | Required -----------|----------|-------------------------------------------|---------|--------- -`exclude` | `string` | Regular expression of volumes to exclude. | `""` | no -`include` | `string` | Regular expression of volumes to include. | `".+"` | no +Name | Type | Description | Default | Required +----------|----------|-------------------------------------------|-----------|--------- +`exclude` | `string` | Regular expression of volumes to exclude. | `"^$"` | no +`include` | `string` | Regular expression of volumes to include. | `"^.+$"` | no Volume names must match the regular expression specified by `include` and must _not_ match the regular expression specified by `exclude` to be included. +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. ### msmq block @@ -142,62 +130,68 @@ Specifying `enabled_classes` is useful to limit the response to the MSMQs you sp Name | Type | Description | Default | Required ---- |----------| ----------- | ------- | -------- -`enabled_classes` | `list(string)` | Comma-separated list of MSSQL WMI classes to use. | `["accessmethods", "availreplica", "bufman", "databases", "dbreplica", "genstats", "locks", "memmgr", "sqlstats", "sqlerrors", "transactions"]` | no - +`enabled_classes` | `list(string)` | A list of MSSQL WMI classes to use. | `["accessmethods", "availreplica", "bufman", "databases", "dbreplica", "genstats", "locks", "memmgr", "sqlstats", "sqlerrors", "transactions", "waitstats"]` | no ### network block -Name | Type | Description | Default | Required -----------|----------|-----------------------------------------|---------|--------- -`exclude` | `string` | Regular expression of NIC:s to exclude. | `""` | no -`include` | `string` | Regular expression of NIC:s to include. | `".*"` | no +Name | Type | Description | Default | Required +----------|----------|-----------------------------------------|-----------|--------- +`exclude` | `string` | Regular expression of NIC:s to exclude. | `"^$"` | no +`include` | `string` | Regular expression of NIC:s to include. | `"^.+$"` | no NIC names must match the regular expression specified by `include` and must _not_ match the regular expression specified by `exclude` to be included. +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. + ### physical_disk block -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 +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 + +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. ### printer block -Name | Type | Description | Default | Required -----------|----------|-------------------------------------------|---------|--------- -`exclude` | `string` | Regular expression of printer to exclude. | `""` | no -`include` | `string` | Regular expression of printer to include. | `".*"` | no +Name | Type | Description | Default | Required +----------|----------|-------------------------------------------|-----------|--------- +`exclude` | `string` | Regular expression of printer to exclude. | `"^$"` | no +`include` | `string` | Regular expression of printer to include. | `"^.+$"` | no Printer must match the regular expression specified by `include` and must _not_ match the regular expression specified by `exclude` to be included. +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. ### process block -Name | Type | Description | Default | Required -----------|----------|---------------------------------------------|---------|--------- -`exclude` | `string` | Regular expression of processes to exclude. | `""` | no -`include` | `string` | Regular expression of processes to include. | `".*"` | no +Name | Type | Description | Default | Required +----------|----------|---------------------------------------------|-----------|--------- +`exclude` | `string` | Regular expression of processes to exclude. | `"^$"` | no +`include` | `string` | Regular expression of processes to include. | `"^.+$"` | no Processes must match the regular expression specified by `include` and must _not_ match the regular expression specified by `exclude` to be included. +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. ### scheduled_task block -Name | Type | Description | Default | Required -----------|----------|-----------------------------|---------|--------- -`exclude` | `string` | Regexp of tasks to exclude. | `""` | no -`include` | `string` | Regexp of tasks to include. | `".+"` | no +Name | Type | Description | Default | Required +----------|----------|-----------------------------------------|-----------|--------- +`exclude` | `string` | Regular expression of tasks to exclude. | `"^$"` | no +`include` | `string` | Regular expression of tasks to include. | `"^.+$"` | no For a server name to be included, it must match the regular expression specified by `include` and must _not_ match the regular expression specified by `exclude`. +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. ### service block -Name | Type | Description | Default | Required -----------------------|----------|-------------------------------------------------------|---------|--------- -`enable_v2_collector` | `string` | Enable V2 service collector. | `""` | no -`use_api` | `string` | Use API calls to collect service data instead of WMI. | `false` | no -`where_clause` | `string` | WQL 'where' clause to use in WMI metrics query. | `""` | no +Name | Type | Description | Default | Required +----------------------|----------|-------------------------------------------------------|-----------|--------- +`enable_v2_collector` | `string` | Enable V2 service collector. | `"false"` | no +`use_api` | `string` | Use API calls to collect service data instead of WMI. | `"false"` | no +`where_clause` | `string` | WQL '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. If `use_api` is enabled, 'where_clause' won't be effective. @@ -206,21 +200,21 @@ The v2 collector can query service states much more efficiently, but can't provi ### smb block -Name | Type | Description | Default | Required ----------------|----------|----------------------------------------------------------------|---------|--------- -`enabled_list` | `string` | Deprecated (no-op), Comma-separated list of collectors to use. | `""` | no +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, `enabled_list` may be set to `"ServerShares"`. +For example, `enabled_list` may be set to `["ServerShares"]`. ### smb_client block -Name | Type | Description | Default | Required ----------------|----------|----------------------------------------------------------------|---------|--------- -`enabled_list` | `string` | Deprecated (no-op), Comma-separated list of collectors to use. | `""` | no +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: @@ -231,19 +225,25 @@ For example, `enabled_list` may be set to `"ClientShares"`. ### smtp block -Name | Type | Description | Default | Required -----------|----------|---------------------------------------|---------|--------- -`exclude` | `string` | Regexp of virtual servers to ignore. | | no -`include` | `string` | Regexp of virtual servers to include. | `".+"` | no +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 For a server name to be included, it must match the regular expression specified by `include` and must _not_ match the regular expression specified by `exclude`. +User-supplied `exclude` and `include` strings will be [wrapped][wrap-regex] in a regular expression. ### text_file block -Name | Type | Description | Default | Required -----------------------|----------|----------------------------------------------------|------------------------------------------------------|--------- -`text_file_directory` | `string` | The directory containing the files to be ingested. | `C:\Program Files\GrafanaLabs\Alloy\textfile_inputs` | no +Name | Type | Description | Default | Required +----------------------|----------|----------------------------------------------------|---------------|--------- +`text_file_directory` | `string` | The directory containing the files to be ingested. | __see_below__ | no + +The default value for `text_file_directory` is relative to the location of the {{< param "PRODUCT_NAME" >}} executable. +By default, `text_file_directory` is set to the `textfile_inputs` directory in the installation directory of {{< param "PRODUCT_NAME" >}}. +For example, if {{< param "PRODUCT_NAME" >}} is installed in `C:\Program Files\GrafanaLabs\Alloy\`, +the default will be `C:\Program Files\GrafanaLabs\Alloy\textfile_inputs`. 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. @@ -268,6 +268,21 @@ debug information. `prometheus.exporter.windows` does not expose any component-specific debug metrics. +[wrap-regex]: #wrapping-of-regex-strings +## Wrapping of regular expression strings + +Some collector blocks such as [scheduled_task][] accept a regular expression as a string argument. +`prometheus.exporter.windows` will prefix some regular expression string arguments with `^(?:` and will suffix them with `)$`. +For example, if a user sets an `exclude` argument to `".*"`, Alloy will set it to `"^(?:.*)$"`. + +To find out if a particular regular expression argument will be wrapped, refer to the collector block documentation. + +{{< admonition type="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". +{{< /admonition >}} + ## 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 @@ -281,59 +296,59 @@ or disable collectors that are expensive to run. Name | Description | Enabled by default ---------|-------------|-------------------- -[ad](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.ad.md) | Active Directory Domain Services | -[adcs](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.adcs.md) | Active Directory Certificate Services | -[adfs](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.adfs.md) | Active Directory Federation Services | -[cache](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.cache.md) | Cache metrics | -[cpu](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.cpu.md) | CPU usage | ✓ -[cpu_info](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.cpu_info.md) | CPU Information | -[cs](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.cs.md) | "Computer System" metrics (system properties, num cpus/total memory) | ✓ -[container](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.container.md) | Container metrics | -[dfsr](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.dfsr.md) | DFSR metrics | -[dhcp](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.dhcp.md) | DHCP Server | -[dns](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.dns.md) | DNS Server | -[exchange](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.exchange.md) | Exchange metrics | -[fsrmquota](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.fsrmquota.md) | Microsoft File Server Resource Manager (FSRM) Quotas collector | -[hyperv](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.hyperv.md) | Hyper-V hosts | -[iis](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.iis.md) | IIS sites and applications | -[logical_disk](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.logical_disk.md) | Logical disks, disk I/O | ✓ -[logon](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.logon.md) | User logon sessions | -[memory](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.memory.md) | Memory usage metrics | -[mscluster_cluster](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.mscluster_cluster.md) | MSCluster cluster metrics | -[mscluster_network](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.mscluster_network.md) | MSCluster network metrics | -[mscluster_node](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.mscluster_node.md) | MSCluster Node metrics | -[mscluster_resource](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.mscluster_resource.md) | MSCluster Resource metrics | -[mscluster_resourcegroup](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.mscluster_resourcegroup.md) | MSCluster ResourceGroup metrics | -[msmq](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.msmq.md) | MSMQ queues | -[mssql](https://github.com/prometheus-community/windows_exporter/blob/master/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_clrexceptions](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrexceptions.md) | .NET Framework CLR Exceptions | -[netframework_clrinterop](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrinterop.md) | .NET Framework Interop Metrics | -[netframework_clrjit](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrjit.md) | .NET Framework JIT metrics | -[netframework_clrloading](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrloading.md) | .NET Framework CLR Loading metrics | -[netframework_clrlocksandthreads](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrlocksandthreads.md) | .NET Framework locks and metrics threads | -[netframework_clrmemory](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrmemory.md) | .NET Framework Memory metrics | -[netframework_clrremoting](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrremoting.md) | .NET Framework Remoting metrics | -[netframework_clrsecurity](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework_clrsecurity.md) | .NET Framework Security Check metrics | -[net](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.net.md) | Network interface I/O | ✓ -[os](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.os.md) | OS metrics (memory, processes, users) | ✓ -[physical_disk](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.physical_disk.md) | Physical disks | ✓ -[printer](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.printer.md) | Printer metrics | -[process](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.process.md) | Per-process metrics | -[remote_fx](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.remote_fx.md) | RemoteFX protocol (RDP) metrics | -[scheduled_task](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.scheduled_task.md) | Scheduled Tasks metrics | -[service](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.service.md) | Service state metrics | ✓ -[smb](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.smb.md) | IIS SMTP Server | -[smb_client](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.smb_client.md) | IIS SMTP Server | -[smtp](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.smtp.md) | IIS SMTP Server | -[system](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.system.md) | System calls | ✓ -[tcp](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.tcp.md) | TCP connections | -[teradici_pcoip](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.teradici_pcoip.md) | [Teradici PCoIP](https://www.teradici.com/web-help/pcoip_wmi_specs/) session metrics | -[time](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.time.md) | Windows Time Service | -[thermalzone](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.thermalzone.md) | Thermal information -[terminal_services](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.terminal_services.md) | Terminal services (RDS) -[textfile](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.textfile.md) | Read prometheus metrics from a text file | -[vmware_blast](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.vmware_blast.md) | VMware Blast session metrics | -[vmware](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.vmware.md) | Performance counters installed by the Vmware Guest agent | +[ad](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.ad.md) | Active Directory Domain Services | +[adcs](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.adcs.md) | Active Directory Certificate Services | +[adfs](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.adfs.md) | Active Directory Federation Services | +[cache](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.cache.md) | Cache metrics | +[cpu](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.cpu.md) | CPU usage | ✓ +[cpu_info](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.cpu_info.md) | CPU Information | +[cs](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.cs.md) | "Computer System" metrics (system properties, num cpus/total memory) | ✓ +[container](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.container.md) | Container metrics | +[dfsr](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.dfsr.md) | DFSR metrics | +[dhcp](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.dhcp.md) | DHCP Server | +[dns](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.dns.md) | DNS Server | +[exchange](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.exchange.md) | Exchange metrics | +[fsrmquota](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.fsrmquota.md) | Microsoft File Server Resource Manager (FSRM) Quotas collector | +[hyperv](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.hyperv.md) | Hyper-V hosts | +[iis](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.iis.md) | IIS sites and applications | +[logical_disk](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.logical_disk.md) | Logical disks, disk I/O | ✓ +[logon](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.logon.md) | User logon sessions | +[memory](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.memory.md) | Memory usage metrics | +[mscluster_cluster](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.mscluster_cluster.md) | MSCluster cluster metrics | +[mscluster_network](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.mscluster_network.md) | MSCluster network metrics | +[mscluster_node](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.mscluster_node.md) | MSCluster Node metrics | +[mscluster_resource](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.mscluster_resource.md) | MSCluster Resource metrics | +[mscluster_resourcegroup](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.mscluster_resourcegroup.md) | MSCluster ResourceGroup metrics | +[msmq](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.msmq.md) | MSMQ queues | +[mssql](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/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_clrexceptions](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrexceptions.md) | .NET Framework CLR Exceptions | +[netframework_clrinterop](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrinterop.md) | .NET Framework Interop Metrics | +[netframework_clrjit](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrjit.md) | .NET Framework JIT metrics | +[netframework_clrloading](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrloading.md) | .NET Framework CLR Loading metrics | +[netframework_clrlocksandthreads](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrlocksandthreads.md) | .NET Framework locks and metrics threads | +[netframework_clrmemory](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrmemory.md) | .NET Framework Memory metrics | +[netframework_clrremoting](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrremoting.md) | .NET Framework Remoting metrics | +[netframework_clrsecurity](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.netframework_clrsecurity.md) | .NET Framework Security Check metrics | +[net](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.net.md) | Network interface I/O | ✓ +[os](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.os.md) | OS metrics (memory, processes, users) | ✓ +[physical_disk](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.physical_disk.md) | Physical disks | ✓ +[printer](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.printer.md) | Printer metrics | +[process](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.process.md) | Per-process metrics | +[remote_fx](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.remote_fx.md) | RemoteFX protocol (RDP) metrics | +[scheduled_task](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.scheduled_task.md) | Scheduled Tasks metrics | +[service](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.service.md) | Service state metrics | ✓ +[smb](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.smb.md) | IIS SMTP Server | +[smb_client](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.smbclient.md) | IIS SMTP Server | +[smtp](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.smtp.md) | IIS SMTP Server | +[system](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.system.md) | System calls | ✓ +[tcp](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.tcp.md) | TCP connections | +[teradici_pcoip](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.teradici_pcoip.md) | [Teradici PCoIP](https://www.teradici.com/web-help/pcoip_wmi_specs/) session metrics | +[time](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.time.md) | Windows Time Service | +[thermalzone](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.thermalzone.md) | Thermal information +[terminal_services](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.terminal_services.md) | Terminal services (RDS) +[textfile](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.textfile.md) | Read prometheus metrics from a text file | +[vmware_blast](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/docs/collector.vmware_blast.md) | VMware Blast session metrics | +[vmware](https://github.com/prometheus-community/windows_exporter/blob/{{< param "PROM_WIN_EXP_VERSION" >}}/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. diff --git a/go.mod b/go.mod index 002ae1ffc6..5db6230b4f 100644 --- a/go.mod +++ b/go.mod @@ -149,7 +149,7 @@ require ( github.com/prometheus-community/elasticsearch_exporter v1.5.0 github.com/prometheus-community/postgres_exporter v0.11.1 github.com/prometheus-community/stackdriver_exporter v0.15.1 - github.com/prometheus-community/windows_exporter v0.27.3 + github.com/prometheus-community/windows_exporter v0.27.4-0.20241010144849-a0f6d3bcf9a4 github.com/prometheus-operator/prometheus-operator v0.66.0 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.66.0 github.com/prometheus-operator/prometheus-operator/pkg/client v0.66.0 diff --git a/go.sum b/go.sum index 5ddf8048ae..1057c74430 100644 --- a/go.sum +++ b/go.sum @@ -2130,6 +2130,8 @@ github.com/prometheus-community/stackdriver_exporter v0.15.1 h1:+k26zeBy8BlG+eDK github.com/prometheus-community/stackdriver_exporter v0.15.1/go.mod h1:UmmIgnrVQqDAeM8pSeYntBcUxPhp8oqb8W3nvRYzsSg= github.com/prometheus-community/windows_exporter v0.27.3 h1:L5Dc4gqc3477Y6jaVHhkm25jysqbxg1ajMyPbmnqScw= github.com/prometheus-community/windows_exporter v0.27.3/go.mod h1:8+T6hfv71nvgVIzguouXkIGoa15ni+uXHHULBOA2bZo= +github.com/prometheus-community/windows_exporter v0.27.4-0.20241010144849-a0f6d3bcf9a4 h1:e6RmefQvH1jXwo7JnN5UvcyZz8uyABMFScnkrrWNrf0= +github.com/prometheus-community/windows_exporter v0.27.4-0.20241010144849-a0f6d3bcf9a4/go.mod h1:8+T6hfv71nvgVIzguouXkIGoa15ni+uXHHULBOA2bZo= github.com/prometheus-operator/prometheus-operator v0.66.0 h1:Jj4mbGAkfBbTih6ait03f2vUjEHB7Kb4gnlAmWu7AJ0= github.com/prometheus-operator/prometheus-operator v0.66.0/go.mod h1:U7S3+u6YTxwCTMNIQxZWttEq70qBA4Qps7/c5mUZOpQ= github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.66.0 h1:PPW01FLVjJHMNcbAL1DDD9EZceSQKMOU/VpK0irrxrI= diff --git a/internal/component/prometheus/exporter/windows/config.go b/internal/component/prometheus/exporter/windows/config.go index d05574d379..0473c4df66 100644 --- a/internal/component/prometheus/exporter/windows/config.go +++ b/internal/component/prometheus/exporter/windows/config.go @@ -1,11 +1,26 @@ package windows import ( + "fmt" "strings" windows_integration "github.com/grafana/alloy/internal/static/integrations/windows_exporter" ) +// Wrap some regex strings to prevent issues with user-supplied empty strings. +// Prior to v0.27, the upstream exporter used to wrap regexes like this. +// Alloy is now doing this instead, to maintain backwards compatibility. +// +// This is mostly to prevent issues with `exclude` arguments. +// If `exclude` is set to `""` and there is no wrapping, the regex will match everything. +// Therefore, all collectors will be excluded. +// +// See https://github.com/grafana/alloy/issues/1845 +// TODO: Remove this in Alloy v2. +func wrapRegex(regex string) string { + return fmt.Sprintf("^(?:%s)$", regex) +} + // Arguments is used for controlling for this exporter. type Arguments struct { // Collectors to mark as enabled @@ -92,14 +107,14 @@ type IISConfig struct { // Convert converts the component's IISConfig to the integration's IISConfig. func (t IISConfig) Convert() windows_integration.IISConfig { return windows_integration.IISConfig{ - AppBlackList: t.AppBlackList, - AppWhiteList: t.AppWhiteList, - SiteBlackList: t.SiteBlackList, - SiteWhiteList: t.SiteWhiteList, - AppExclude: t.AppExclude, - AppInclude: t.AppInclude, - SiteExclude: t.SiteExclude, - SiteInclude: t.SiteInclude, + AppBlackList: wrapRegex(t.AppBlackList), + AppWhiteList: wrapRegex(t.AppWhiteList), + SiteBlackList: wrapRegex(t.SiteBlackList), + SiteWhiteList: wrapRegex(t.SiteWhiteList), + AppExclude: wrapRegex(t.AppExclude), + AppInclude: wrapRegex(t.AppInclude), + SiteExclude: wrapRegex(t.SiteExclude), + SiteInclude: wrapRegex(t.SiteInclude), } } @@ -126,10 +141,10 @@ type SMTPConfig struct { // Convert converts the component's SMTPConfig to the integration's SMTPConfig. func (t SMTPConfig) Convert() windows_integration.SMTPConfig { return windows_integration.SMTPConfig{ - BlackList: t.BlackList, - WhiteList: t.WhiteList, - Exclude: t.Exclude, - Include: t.Include, + BlackList: wrapRegex(t.BlackList), + WhiteList: wrapRegex(t.WhiteList), + Exclude: wrapRegex(t.Exclude), + Include: wrapRegex(t.Include), } } @@ -160,10 +175,10 @@ type ProcessConfig struct { // Convert converts the component's ProcessConfig to the integration's ProcessConfig. func (t ProcessConfig) Convert() windows_integration.ProcessConfig { return windows_integration.ProcessConfig{ - BlackList: t.BlackList, - WhiteList: t.WhiteList, - Exclude: t.Exclude, - Include: t.Include, + BlackList: wrapRegex(t.BlackList), + WhiteList: wrapRegex(t.WhiteList), + Exclude: wrapRegex(t.Exclude), + Include: wrapRegex(t.Include), } } @@ -176,8 +191,8 @@ type ScheduledTaskConfig struct { // Convert converts the component's ScheduledTaskConfig to the integration's ScheduledTaskConfig. func (t ScheduledTaskConfig) Convert() windows_integration.ScheduledTaskConfig { return windows_integration.ScheduledTaskConfig{ - Exclude: t.Exclude, - Include: t.Include, + Exclude: wrapRegex(t.Exclude), + Include: wrapRegex(t.Include), } } @@ -192,10 +207,10 @@ type NetworkConfig struct { // Convert converts the component's NetworkConfig to the integration's NetworkConfig. func (t NetworkConfig) Convert() windows_integration.NetworkConfig { return windows_integration.NetworkConfig{ - BlackList: t.BlackList, - WhiteList: t.WhiteList, - Exclude: t.Exclude, - Include: t.Include, + BlackList: wrapRegex(t.BlackList), + WhiteList: wrapRegex(t.WhiteList), + Exclude: wrapRegex(t.Exclude), + Include: wrapRegex(t.Include), } } @@ -234,10 +249,10 @@ type LogicalDiskConfig struct { // Convert converts the component's LogicalDiskConfig to the integration's LogicalDiskConfig. func (t LogicalDiskConfig) Convert() windows_integration.LogicalDiskConfig { return windows_integration.LogicalDiskConfig{ - BlackList: t.BlackList, - WhiteList: t.WhiteList, - Include: t.Include, - Exclude: t.Exclude, + BlackList: wrapRegex(t.BlackList), + WhiteList: wrapRegex(t.WhiteList), + Include: wrapRegex(t.Include), + Exclude: wrapRegex(t.Exclude), } } @@ -250,8 +265,8 @@ type PhysicalDiskConfig struct { // Convert converts the component's PhysicalDiskConfig to the integration's PhysicalDiskConfig. func (t PhysicalDiskConfig) Convert() windows_integration.PhysicalDiskConfig { return windows_integration.PhysicalDiskConfig{ - Include: t.Include, - Exclude: t.Exclude, + Include: wrapRegex(t.Include), + Exclude: wrapRegex(t.Exclude), } } @@ -264,8 +279,8 @@ type PrinterConfig struct { // Convert converts the component's ProcessConfig to the integration's ProcessConfig. func (t PrinterConfig) Convert() windows_integration.PrinterConfig { return windows_integration.PrinterConfig{ - Exclude: t.Exclude, - Include: t.Include, + Exclude: wrapRegex(t.Exclude), + Include: wrapRegex(t.Include), } } diff --git a/internal/component/prometheus/exporter/windows/config_default_windows_test.go b/internal/component/prometheus/exporter/windows/config_default_windows_test.go index 5a7bc93077..cd288f5e22 100644 --- a/internal/component/prometheus/exporter/windows/config_default_windows_test.go +++ b/internal/component/prometheus/exporter/windows/config_default_windows_test.go @@ -1,6 +1,8 @@ package windows import ( + "os" + "path/filepath" "testing" "github.com/grafana/alloy/syntax" @@ -44,3 +46,43 @@ func TestAlloyUnmarshalWithDefaultConfig(t *testing.T) { require.Equal(t, defaultArgs.SMTP.Include, args.SMTP.Include) require.Equal(t, defaultArgs.TextFile.TextFileDirectory, args.TextFile.TextFileDirectory) } + +// This is a copy of the getDefaultPath() function in: +// windows_exporter@v0.27.4-0.20241010144849-a0f6d3bcf9a4\pkg\collector\textfile\textfile.go +func getDefaultTextFilePath() string { + execPath, _ := os.Executable() + return filepath.Join(filepath.Dir(execPath), "textfile_inputs") +} + +func TestDefaultConfig(t *testing.T) { + // TODO: The BlackList and WhiteList attributes should be removed in Alloy v2. + // They are not even documented in Alloy v1. + expected := Arguments{ + EnabledCollectors: []string{"cpu", "cs", "logical_disk", "net", "os", "service", "system"}, + Dfsr: DfsrConfig{SourcesEnabled: []string{"connection", "folder", "volume"}}, + Exchange: ExchangeConfig{EnabledList: []string{"ADAccessProcesses", "TransportQueues", "HttpProxy", "ActiveSync", "AvailabilityService", "OutlookWebAccess", "Autodiscover", "WorkloadManagement", "RpcClientAccess", "MapiHttpEmsmdb"}}, + IIS: IISConfig{AppBlackList: "^$", AppWhiteList: "^.+$", SiteBlackList: "^$", SiteWhiteList: "^.+$", AppExclude: "^$", AppInclude: "^.+$", SiteExclude: "^$", SiteInclude: "^.+$"}, + LogicalDisk: LogicalDiskConfig{BlackList: "^$", WhiteList: "^.+$", Include: "^.+$", Exclude: "^$"}, + MSMQ: MSMQConfig{Where: ""}, + MSSQL: MSSQLConfig{EnabledClasses: []string{"accessmethods", "availreplica", "bufman", "databases", "dbreplica", "genstats", "locks", "memmgr", "sqlstats", "sqlerrors", "transactions", "waitstats"}}, + Network: NetworkConfig{BlackList: "^$", WhiteList: "^.+$", Exclude: "^$", Include: "^.+$"}, + PhysicalDisk: PhysicalDiskConfig{Include: "^.+$", Exclude: "^$"}, + Printer: PrinterConfig{Exclude: "^$", Include: "^.+$"}, + Process: ProcessConfig{BlackList: "^$", WhiteList: "^.+$", Exclude: "^$", Include: "^.+$"}, + ScheduledTask: ScheduledTaskConfig{Exclude: "^$", Include: "^.+$"}, + Service: ServiceConfig{UseApi: "false", Where: "", V2: "false"}, + SMB: SMBConfig{EnabledList: []string{}}, + SMBClient: SMBClientConfig{EnabledList: []string{}}, + SMTP: SMTPConfig{BlackList: "^$", WhiteList: "^.+$", Exclude: "^$", Include: "^.+$"}, + TextFile: TextFileConfig{TextFileDirectory: getDefaultTextFilePath()}, + } + + var args Arguments + err := syntax.Unmarshal([]byte(""), &args) + require.NoError(t, err) + require.Equal(t, expected, args) + + var defaultArgs Arguments + defaultArgs.SetToDefault() + require.Equal(t, expected, defaultArgs) +} diff --git a/internal/component/prometheus/exporter/windows/windows_test.go b/internal/component/prometheus/exporter/windows/windows_test.go index 0234afa265..861117c9e5 100644 --- a/internal/component/prometheus/exporter/windows/windows_test.go +++ b/internal/component/prometheus/exporter/windows/windows_test.go @@ -119,27 +119,27 @@ func TestConvert(t *testing.T) { require.Equal(t, "textfile,cpu", conf.EnabledCollectors) require.Equal(t, "example", conf.Exchange.EnabledList) - require.Equal(t, "", conf.IIS.SiteExclude) - require.Equal(t, ".+", conf.IIS.SiteInclude) - require.Equal(t, "", conf.IIS.AppExclude) - require.Equal(t, ".+", conf.IIS.AppInclude) + require.Equal(t, "^(?:)$", conf.IIS.SiteExclude) + require.Equal(t, "^(?:.+)$", conf.IIS.SiteInclude) + require.Equal(t, "^(?:)$", conf.IIS.AppExclude) + require.Equal(t, "^(?:.+)$", conf.IIS.AppInclude) require.Equal(t, "C:", conf.TextFile.TextFileDirectory) - require.Equal(t, "", conf.SMTP.Exclude) - require.Equal(t, ".+", conf.SMTP.Include) + require.Equal(t, "^(?:)$", conf.SMTP.Exclude) + require.Equal(t, "^(?:.+)$", conf.SMTP.Include) require.Equal(t, "where", conf.Service.Where) require.Equal(t, "true", conf.Service.V2) - require.Equal(t, "", conf.PhysicalDisk.Exclude) - require.Equal(t, ".+", conf.PhysicalDisk.Include) - require.Equal(t, "", conf.Process.Exclude) - require.Equal(t, ".+", conf.Process.Include) - require.Equal(t, "", conf.Printer.Exclude) - require.Equal(t, ".+", conf.Printer.Include) + require.Equal(t, "^(?:)$", conf.PhysicalDisk.Exclude) + require.Equal(t, "^(?:.+)$", conf.PhysicalDisk.Include) + require.Equal(t, "^(?:)$", conf.Process.Exclude) + require.Equal(t, "^(?:.+)$", conf.Process.Include) + require.Equal(t, "^(?:)$", conf.Printer.Exclude) + require.Equal(t, "^(?:.+)$", conf.Printer.Include) require.Equal(t, "example", conf.SMB.EnabledList) require.Equal(t, "example", conf.SMBClient.EnabledList) - require.Equal(t, "", conf.Network.Exclude) - require.Equal(t, ".+", conf.Network.Include) + require.Equal(t, "^(?:)$", conf.Network.Exclude) + require.Equal(t, "^(?:.+)$", conf.Network.Include) require.Equal(t, "accessmethods", conf.MSSQL.EnabledClasses) require.Equal(t, "where", conf.MSMQ.Where) - require.Equal(t, "", conf.LogicalDisk.Exclude) - require.Equal(t, ".+", conf.LogicalDisk.Include) + require.Equal(t, "^(?:)$", conf.LogicalDisk.Exclude) + require.Equal(t, "^(?:.+)$", conf.LogicalDisk.Include) }