Skip to content

Commit 173a9f2

Browse files
committed
libnet: don't put external DNS answers in OTel spans
When containers make DNS resolution, and the domain name they're trying to resolve doesn't match any running container, the DNS query is forwarded to upstream servers. In that case, when we receive a response, we put it in an OTel spans. This was useful to debug DNS resolution on GHA, but it leads to excessive memory usage when DNS resolution happen in a tight loop. So, keep the OTel event signaling that a response was received, but drop the answer from the OTel span. Signed-off-by: Albin Kerouanton <[email protected]>
1 parent c14efb8 commit 173a9f2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

libnetwork/resolver.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,7 @@ func (r *Resolver) forwardExtDNS(ctx context.Context, proto string, remoteAddr n
600600
r.log(ctx).Debugf("[resolver] external DNS %s:%s returned response with no answers:\n%s", proto, extDNS.IPStr, resp)
601601
}
602602
resp.Compress = true
603-
span.AddEvent("response from upstream server", trace.WithAttributes(
604-
attribute.String("libnet.resolver.resp", resp.String()),
605-
))
603+
span.AddEvent("response from upstream server")
606604
return resp
607605
}
608606

0 commit comments

Comments
 (0)