From fb14808de0906453d3fa93cefd77b7ded89d49ef Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Sun, 27 Oct 2024 01:46:30 +0200 Subject: [PATCH] fix: resolve deprecated sdk function to detect address --- pkg/exporter/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/exporter/server.go b/pkg/exporter/server.go index 915fa9a..2e9a608 100644 --- a/pkg/exporter/server.go +++ b/pkg/exporter/server.go @@ -145,8 +145,9 @@ func (c *ServerCollector) Collect(ch chan<- prometheus.Metric) { privateIP = *server.PrivateIP } - if server.PublicIP != nil { - publicIP = server.PublicIP.Address.String() + for _, ip := range server.PublicIPs { + publicIP = ip.Address.String() + break } labels := []string{