1
0
mirror of https://github.com/prometheus-community/windows_exporter.git synced 2025-04-18 19:24:05 +03:00

net: fix sanitize # on the nic label for windows_net_nic_address_info (#1839)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke 2025-01-17 13:34:21 +01:00 committed by GitHub
parent f73a74b678
commit f0f3d0d96e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -391,7 +391,7 @@ func (c *Collector) collectNICAddresses(ch chan<- prometheus.Metric) error {
return err
}
convertNicName := strings.NewReplacer("(", "[", ")", "]")
convertNicName := strings.NewReplacer("(", "[", ")", "]", "#", "_")
for _, nicAdapterAddress := range nicAdapterAddresses {
friendlyName := windows.UTF16PtrToString(nicAdapterAddress.FriendlyName)