From da7bb0f4ece66528c90198450295da00878a2604 Mon Sep 17 00:00:00 2001 From: Paulin Todev Date: Tue, 5 Mar 2024 12:18:09 +0000 Subject: [PATCH 1/2] Clarify the use of use_api in docs. --- .../components/prometheus.exporter.windows.md | 13 +++++++++---- .../integrations/windows-exporter-config.md | 9 +++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/sources/flow/reference/components/prometheus.exporter.windows.md b/docs/sources/flow/reference/components/prometheus.exporter.windows.md index 85c294825665..3b3dd041c2fe 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.windows.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.windows.md @@ -172,14 +172,19 @@ For a server name to be included, it must match the regular expression specified ### service block -Name | Type | Description | Default | Required ----------------|----------|-------------------------------------------------------|---------|--------- -`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 +---------------|----------|-------------------------------------------------------------|---------|--------- +`use_api` | `string` | Use the Windows API 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. +The Windows API is more performant than WMI. Set `use_api` to `true` in situations when the WMI takes too long to get the service information. +Setting `use_api` to `true` does have a few disadvantages compared to using WMI: +* WMI queries in `where_clause` won't work. +* The `status` field of the service won't be reported. Instead, use the `state` property. It has the same information, albeit formatted differently. + ### smtp block diff --git a/docs/sources/static/configuration/integrations/windows-exporter-config.md b/docs/sources/static/configuration/integrations/windows-exporter-config.md index bcb753b0860c..a19dccd58db4 100644 --- a/docs/sources/static/configuration/integrations/windows-exporter-config.md +++ b/docs/sources/static/configuration/integrations/windows-exporter-config.md @@ -113,6 +113,15 @@ Full reference of options: # "WQL 'where' clause to use in WMI metrics query. Limits the response to the services you specify and reduces the size of the response. # Maps to collector.service.services-where in windows_exporter [where_clause: | default=""] + # If "use_api" is set to "true", service data will be collected via the Windows API. + # If "use_api" is set to "false", service data will be collected via WMI. + # When "use_api" is set to "true", "where_clause" will be ignored and will not take effect. + # The Windows API is more performant than WMI. Set `use_api` to `true` in situations when the WMI takes too long to get the service information. + # Setting `use_api` to `true` does have a few disadvantages compared to using WMI: + # * WMI queries in `where_clause` won't work. + # * The `status` field of the service won't be reported. Instead, use the `state` property. + # It has the same information, albeit formatted differently. + [use_api: | default = false] # Configuration for physical disk on Windows physical_disk: From f028491818ac469821b0dbb1204d1b94cf3aee58 Mon Sep 17 00:00:00 2001 From: Paulin Todev Date: Tue, 4 Jun 2024 12:29:47 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> --- .../flow/reference/components/prometheus.exporter.windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/flow/reference/components/prometheus.exporter.windows.md b/docs/sources/flow/reference/components/prometheus.exporter.windows.md index 3b3dd041c2fe..a38befddde21 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.windows.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.windows.md @@ -183,7 +183,7 @@ If `use_api` is enabled, 'where_clause' won't be effective. The Windows API is more performant than WMI. Set `use_api` to `true` in situations when the WMI takes too long to get the service information. Setting `use_api` to `true` does have a few disadvantages compared to using WMI: * WMI queries in `where_clause` won't work. -* The `status` field of the service won't be reported. Instead, use the `state` property. It has the same information, albeit formatted differently. +* The `status` field of the service is not available. You can use the `state` property to retrieve status information. This property provides the same information, but it is formatted differently. ### smtp block