From 7cf580cef5cd9d23ed978ff3f0b5e66d5ce26c53 Mon Sep 17 00:00:00 2001 From: matt durham Date: Tue, 23 Mar 2021 14:55:46 -0400 Subject: [PATCH 1/3] Fix issue with config and submit documentation --- docs/configuration-reference.md | 192 ++++++++++++++++++++ pkg/integrations/windows_exporter/config.go | 2 +- 2 files changed, 193 insertions(+), 1 deletion(-) diff --git a/docs/configuration-reference.md b/docs/configuration-reference.md index 42d57a2c3533..0fa5ffbc7711 100644 --- a/docs/configuration-reference.md +++ b/docs/configuration-reference.md @@ -2103,6 +2103,9 @@ statsd_exporter: # Controls the consul_exporter integration consul_exporter: +#Controls the windows_exporter integration +windows_exporter: + # Automatically collect metrics from enabled integrations. If disabled, # integrations will be run but not scraped and thus not remote_written. Metrics # for integrations will be exposed at /integrations//metrics @@ -3434,3 +3437,192 @@ Full reference of options: # Forces the read to be fully consistent. [require_consistent: | default = false] ``` + + +### windows_exporter_config + +The `windows_exporter_config` block configures the `windows_exporter` +integration, which is an embedded version of +[`windows_exporter`](https://github.com/grafana/windows_exporter). This allows +for the collection of windows metrics and exposing them as Prometheus metrics. + +Full reference of options: + +```yaml + # Enables the windows_exporter integration, allowing the Agent to automatically + # collect system metrics from the local windows instance + [enabled: | default = false] + + # Automatically collect metrics from this integration. If disabled, + # the consul_exporter integration will be run but not scraped and thus not + # remote-written. Metrics for the integration will be exposed at + # /integrations/windows_exporter/metrics and can be scraped by an external + # process. + [scrape_integration: | default = ] + + # How often should the metrics be collected? Defaults to + # prometheus.global.scrape_interval. + [scrape_interval: | default = ] + + # The timeout before considering the scrape a failure. Defaults to + # prometheus.global.scrape_timeout. + [scrape_timeout: | default = ] + + # Allows for relabeling labels on the target. + relabel_configs: + [- ... ] + + # Relabel metrics coming from the integration, allowing to drop series + # from the integration that you don't care about. + metric_relabel_configs: + [ - ... ] + + # How frequent to truncate the WAL for this integration. + [wal_truncate_frequency: | default = "60m"] + + # Monitor the exporter itself and include those metrics in the results. + [include_exporter_metrics: | default = false] + + # + # Exporter-specific configuration options + # + + # List of collectors to enable + [enabled_collectors: | default = "cpu,cs,logical_disk,net,os,service,system,textfile"] + + # The following settings are only used if they are enabled by specifying them in enabled_collectors + + [exchange: ] + + [iis: ] + + [text_file: ] + + [smtp: ] + + [service: ] + + [process: ] + + [network: ] + + [mssql: ] + + [msqm: ] + + [logical_disk: ] +``` + +#### exchange_config + +```yaml + # Comma-separated List of collectors to use. Defaults to all, if not specified. + # Maps to collectors.exchange.enabled in windows_exporter + [enabled_list: ] +``` + + +#### iis_config + +```yaml + # Regexp of sites to whitelist. Site name must both match whitelist and not match blacklist to be included. + # Maps to collector.iis.site-whitelist in windows_exporter + [site_whitelist: | default = ".+"] + + # Regexp of sites to blacklist. Site name must both match whitelist and not match blacklist to be included. + # Maps to collector.iis.site-blacklist in windows_exporter + [site_blacklist: | default = ""] + + # Regexp of apps to whitelist. App name must both match whitelist and not match blacklist to be included. + # Maps to collector.iis.app-whitelist in windows_exporter + [app_whitelist: | default=".+"] + + # Regexp of apps to blacklist. App name must both match whitelist and not match blacklist to be included. + # Maps to collector.iis.app-blacklist in windows_exporter + [app_blacklist: | default=".+"] +``` + + +#### text_file_config + +```yaml + # Directory to read text files with metrics from. + # Maps to collector.textfile.directory in windows_exporter + [text_file_directory: | default="C:\Program Files\windows_exporter\textfile_inputs"] +``` + +#### smtp_config + +```yaml + # Directory to read text files with metrics from. + # Maps to collector.textfile.directory in windows_exporter + [text_file_directory: | default="C:\Program Files\windows_exporter\textfile_inputs"] +``` + + +#### service_config + +```yaml + # "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=""] +``` + +#### process_config + +```yaml + # Regexp of processes to include. Process name must both match whitelist and not match blacklist to be included. + # Maps to collector.process.whitelist in windows_exporter + [whitelist: | default=".+"] + + # Regexp of processes to exclude. Process name must both match whitelist and not match blacklist to be included. + # Maps to collector.process.blacklist in windows_exporter + [blacklist: | default=""] +``` + + +#### network_config + +```yaml + # Regexp of NIC's to whitelist. NIC name must both match whitelist and not match blacklist to be included. + # Maps to collector.net.nic-whitelist in windows_exporter + [whitelist: | default=".+"] + + # Regexp of NIC's to blacklist. NIC name must both match whitelist and not match blacklist to be included. + # Maps to collector.net.nic-blacklist in windows_exporter + [blacklist: | default=""] +``` + + +#### mssql_config + +```yaml + # Comma-separated list of mssql WMI classes to use. + # Maps to collectors.mssql.classes-enabled in windows_exporter + [enable_classes: | default="accessmethods,availreplica,bufman,databases,dbreplica,genstats,locks,memmgr,sqlstats,sqlerrors,transactions"] +``` + + +#### msmq_config + +```yaml + # WQL 'where' clause to use in WMI metrics query. Limits the response to the msmqs you specify and reduces the size of the response. + # Maps to collector.msmq.msmq-where in windows_exporter + [where_clause: | default=""] +``` +#### logical_disk_config + +```yaml + # Regexp of volumes to whitelist. Volume name must both match whitelist and not match blacklist to be included. + # Maps to collector.logical_disk.volume-whitelist in windows_exporter + [whitelist: | default=".+"] + + # Regexp of volumes to blacklist. Volume name must both match whitelist and not match blacklist to be included. + # Maps to collector.logical_disk.volume-blaclist in windows_exporter + [blacklist: | default=".+"] +``` + + + + + diff --git a/pkg/integrations/windows_exporter/config.go b/pkg/integrations/windows_exporter/config.go index 5ebc5907907c..d91c3ffa8a68 100644 --- a/pkg/integrations/windows_exporter/config.go +++ b/pkg/integrations/windows_exporter/config.go @@ -115,7 +115,7 @@ type NetworkConfig struct { } type MSSQLConfig struct { - EnabledCollectors *string `yaml:"enabled_collectors" exporter:"collectors.mssql.classes-enabled"` + EnabledClasses *string `yaml:"enabled_classes" exporter:"collectors.mssql.classes-enabled"` } type MSMQConfig struct { From 3390b9c4f8e3540407762aad187587a1ca5691af Mon Sep 17 00:00:00 2001 From: mattdurham Date: Thu, 25 Mar 2021 14:01:11 -0400 Subject: [PATCH 2/3] Update configuration-reference.md Fix smtp --- docs/configuration-reference.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/configuration-reference.md b/docs/configuration-reference.md index 0fa5ffbc7711..b67a80ac8c9f 100644 --- a/docs/configuration-reference.md +++ b/docs/configuration-reference.md @@ -3554,9 +3554,13 @@ Full reference of options: #### smtp_config ```yaml - # Directory to read text files with metrics from. - # Maps to collector.textfile.directory in windows_exporter - [text_file_directory: | default="C:\Program Files\windows_exporter\textfile_inputs"] + # Regexp of virtual servers to whitelist. Server name must both match whitelist and not match blacklist to be included. + # Maps to collector.smtp.server-whitelist in windows_exporter + [whitelist: | default=".+"] + + # Regexp of virtual servers to blacklist. Server name must both match whitelist and not match blacklist to be included. + # Maps to collector.smtp.server-blacklist in windows_exporter + [blacklist: | default=""] ``` From 18471ba339c18bff37b75199bbbed5f229b269c4 Mon Sep 17 00:00:00 2001 From: mattdurham Date: Thu, 25 Mar 2021 14:02:54 -0400 Subject: [PATCH 3/3] Update configuration-reference.md Fix type in mssql_config --- docs/configuration-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration-reference.md b/docs/configuration-reference.md index b67a80ac8c9f..74cfbb26f4cb 100644 --- a/docs/configuration-reference.md +++ b/docs/configuration-reference.md @@ -3603,7 +3603,7 @@ Full reference of options: ```yaml # Comma-separated list of mssql WMI classes to use. # Maps to collectors.mssql.classes-enabled in windows_exporter - [enable_classes: | default="accessmethods,availreplica,bufman,databases,dbreplica,genstats,locks,memmgr,sqlstats,sqlerrors,transactions"] + [enabled_classes: | default="accessmethods,availreplica,bufman,databases,dbreplica,genstats,locks,memmgr,sqlstats,sqlerrors,transactions"] ```