From ce5baa8176d073f5bfb0fb63d16057099a391d69 Mon Sep 17 00:00:00 2001 From: Nikolay Sivko Date: Fri, 10 May 2024 11:34:23 +0300 Subject: [PATCH] fix garbage collection process for FQDN metrics --- containers/registry.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/containers/registry.go b/containers/registry.go index 4350497..3997320 100644 --- a/containers/registry.go +++ b/containers/registry.go @@ -158,12 +158,12 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) { } activeIPs := map[netaddr.IP]struct{}{} for id, c := range r.containersById { - if !c.Dead(now) { - continue - } for dst := range c.connectLastAttempt { activeIPs[dst.IP()] = struct{}{} } + if !c.Dead(now) { + continue + } klog.Infoln("deleting dead container:", id) for cg, cc := range r.containersByCgroupId { if cc == c {