Skip to content

Commit

Permalink
Fix converter output for prometheus.exporter.windows to not unnecessa…
Browse files Browse the repository at this point in the history
…rily add empty blocks (#5817)
  • Loading branch information
erikbaranowski authored Nov 20, 2023
1 parent 39b78a8 commit 165914b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Main (unreleased)

- Fix default configuration file `grafana-agent-flow.river` used in downstream packages. (@bricewge)

- Fix converter output for prometheus.exporter.windows to not unnecessarily add empty blocks. (@erikbaranowski)

v0.38.0-rc.0 (2023-11-16)
-------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package build

import (
"strings"

"github.com/grafana/agent/component/discovery"
"github.com/grafana/agent/component/prometheus/exporter/windows"
"github.com/grafana/agent/pkg/integrations/windows_exporter"
Expand All @@ -13,12 +15,12 @@ func (b *IntegrationsConfigBuilder) appendWindowsExporter(config *windows_export

func toWindowsExporter(config *windows_exporter.Config) *windows.Arguments {
return &windows.Arguments{
EnabledCollectors: splitByCommaNullOnEmpty(config.EnabledCollectors),
EnabledCollectors: strings.Split(config.EnabledCollectors, ","),
Dfsr: windows.DfsrConfig{
SourcesEnabled: splitByCommaNullOnEmpty(config.Dfsr.SourcesEnabled),
SourcesEnabled: strings.Split(config.Dfsr.SourcesEnabled, ","),
},
Exchange: windows.ExchangeConfig{
EnabledList: splitByCommaNullOnEmpty(config.Exchange.EnabledList),
EnabledList: strings.Split(config.Exchange.EnabledList, ","),
},
IIS: windows.IISConfig{
AppBlackList: config.IIS.AppBlackList,
Expand All @@ -40,7 +42,7 @@ func toWindowsExporter(config *windows_exporter.Config) *windows.Arguments {
Where: config.MSMQ.Where,
},
MSSQL: windows.MSSQLConfig{
EnabledClasses: splitByCommaNullOnEmpty(config.MSSQL.EnabledClasses),
EnabledClasses: strings.Split(config.MSSQL.EnabledClasses, ","),
},
Network: windows.NetworkConfig{
BlackList: config.Network.BlackList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ prometheus.remote_write "metrics_default" {
}
}

prometheus.exporter.windows "integrations_windows_exporter" {
exchange { }

network {
exclude = ".+"
}
}
prometheus.exporter.windows "integrations_windows_exporter" { }

prometheus.scrape "integrations_windows" {
targets = prometheus.exporter.windows.integrations_windows_exporter.targets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ http {
}
}

prometheus.exporter.windows "integrations_windows_exporter" {
exchange { }

network {
exclude = ".+"
}
}
prometheus.exporter.windows "integrations_windows_exporter" { }

prometheus.scrape "integrations_windows_exporter" {
targets = prometheus.exporter.windows.integrations_windows_exporter.targets
Expand Down

0 comments on commit 165914b

Please sign in to comment.