diff --git a/pkg/internal/transform/kube/db.go b/pkg/internal/transform/kube/db.go index d7b8732a2..051a5f22e 100644 --- a/pkg/internal/transform/kube/db.go +++ b/pkg/internal/transform/kube/db.go @@ -150,7 +150,6 @@ func (id *Database) OwnerPodInfo(pidNamespace uint32) (*kube.PodInfo, bool) { } func (id *Database) UpdateNewPodsByIPIndex(pod *kube.PodInfo) { - dblog().Debug("updating pod by IP index", "pod", pod.Name, "ips", pod.IPInfo.IPs) if len(pod.IPInfo.IPs) > 0 { id.podsMut.Lock() defer id.podsMut.Unlock() @@ -161,7 +160,6 @@ func (id *Database) UpdateNewPodsByIPIndex(pod *kube.PodInfo) { } func (id *Database) UpdateDeletedPodsByIPIndex(pod *kube.PodInfo) { - dblog().Debug("deleting pod by IP index", "pod", pod.Name, "ips", pod.IPInfo.IPs) if len(pod.IPInfo.IPs) > 0 { id.podsMut.Lock() defer id.podsMut.Unlock() @@ -178,7 +176,6 @@ func (id *Database) PodInfoForIP(ip string) *kube.PodInfo { } func (id *Database) UpdateNewServicesByIPIndex(svc *kube.ServiceInfo) { - dblog().Debug("updating service by IP index", "service", svc.Name, "ips", svc.IPInfo.IPs) if len(svc.IPInfo.IPs) > 0 { id.svcMut.Lock() defer id.svcMut.Unlock() @@ -189,7 +186,6 @@ func (id *Database) UpdateNewServicesByIPIndex(svc *kube.ServiceInfo) { } func (id *Database) UpdateDeletedServicesByIPIndex(svc *kube.ServiceInfo) { - dblog().Debug("deleting service by IP index", "service", svc.Name, "ips", svc.IPInfo.IPs) if len(svc.IPInfo.IPs) > 0 { id.svcMut.Lock() defer id.svcMut.Unlock() @@ -210,16 +206,13 @@ func (id *Database) HostNameForIP(ip string) string { svc, ok := id.svcByIP[ip] id.svcMut.RUnlock() if ok { - dblog().Debug("found service for IP", "ip", ip, "service", svc.Name) return svc.Name } id.podsMut.RLock() pod, ok := id.podsByIP[ip] id.podsMut.RUnlock() if ok { - dblog().Debug("found pod for IP", "ip", ip, "pod", pod.Name) return pod.Name } - dblog().Debug("no service or pod found for IP", "ip", ip) return "" } diff --git a/pkg/transform/name_resolver.go b/pkg/transform/name_resolver.go index 5eb6520a3..8b4277738 100644 --- a/pkg/transform/name_resolver.go +++ b/pkg/transform/name_resolver.go @@ -2,7 +2,6 @@ package transform import ( "context" - "log/slog" "net" "strings" "time" @@ -42,10 +41,6 @@ func NameResolutionProvider(ctxInfo *global.ContextInfo, cfg *NameResolverConfig } } -func log() *slog.Logger { - return slog.With("component", "transform.NameResolver") -} - func nameResolver(ctxInfo *global.ContextInfo, cfg *NameResolverConfig) (pipe.MiddleFunc[[]request.Span, []request.Span], error) { nr := NameResolver{ cfg: cfg, @@ -83,11 +78,9 @@ func (nr *NameResolver) resolveNames(span *request.Span) { if span.IsClientSpan() { hn, span.OtherNamespace = nr.resolve(&span.ServiceID, span.Host) pn, _ = nr.resolve(&span.ServiceID, span.Peer) - log().Debug("resolved client span", "service", span.ServiceID.Name, "pn", pn, "hn", hn, "host", span.Host) } else { pn, span.OtherNamespace = nr.resolve(&span.ServiceID, span.Peer) hn, _ = nr.resolve(&span.ServiceID, span.Host) - log().Debug("resolved server span", "service", span.ServiceID.Name, "pn", pn, "hn", hn, "peer", span.Peer) } // don't set names if the peer and host names have been already decorated // in a previous stage (e.g. Kubernetes decorator) @@ -172,10 +165,7 @@ func (nr *NameResolver) resolveFromK8s(ip string) (string, string) { } func (nr *NameResolver) resolveIP(ip string) string { - log().Debug("Performing DNS lookup for IP", "ip", ip) - if host, ok := nr.cache.Get(ip); ok { - log().Debug("Cache hit for IP", "ip", ip, "hostname", host) return host } @@ -183,18 +173,15 @@ func (nr *NameResolver) resolveIP(ip string) string { addr, err := r.LookupAddr(context.Background(), ip) if err != nil { - log().Error("Failed to perform DNS lookup", "ip", ip, "error", err) nr.cache.Add(ip, ip) return ip } for _, a := range addr { - log().Debug("Resolved IP to hostname", "ip", ip, "hostname", a) nr.cache.Add(ip, a) return a } - log().Warn("No hostname found for IP", "ip", ip) nr.cache.Add(ip, ip) return ip }