From 9ba2cefde4896163d7258fdaa2e876af07103dec Mon Sep 17 00:00:00 2001 From: mattdurham Date: Mon, 8 Jan 2024 10:43:53 -0500 Subject: [PATCH] add call to set perf query (#6065) --- CHANGELOG.md | 3 +++ .../windows_exporter/windows_exporter_windows.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cedc1c803d2..1fdcf93fb642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,6 +102,9 @@ v0.39.0-rc.0 (2024-01-05) - Fix issue where `prometheus.exporter.kafka` would crash when configuring `sasl_password`. (@rfratto) +- Fix performance issue where perf lib where clause was not being set, leading to timeouts in collecting metrics for windows_exporter. (@mattdurham) + + ### Other changes - Bump github.com/IBM/sarama from v1.41.2 to v1.42.1 diff --git a/pkg/integrations/windows_exporter/windows_exporter_windows.go b/pkg/integrations/windows_exporter/windows_exporter_windows.go index fd0a7effe023..94e05f1121a6 100644 --- a/pkg/integrations/windows_exporter/windows_exporter_windows.go +++ b/pkg/integrations/windows_exporter/windows_exporter_windows.go @@ -23,6 +23,11 @@ func New(logger log.Logger, c *Config) (integrations.Integration, error) { if err != nil { return nil, err } + err = winCol.SetPerfCounterQuery() + if err != nil { + return nil, err + } + return integrations.NewCollectorIntegration(c.Name(), integrations.WithCollectors( // Hard-coded 4m timeout to represent the time a series goes stale. // TODO: Make configurable if useful.