@@ -84,7 +84,6 @@ type npCollectorImpl struct {
8484 networkDevicesNamespace string
8585 filterMutex sync.RWMutex
8686 filter * connfilter.ConnFilter
87- localFilter * connfilter.ConnFilter
8887 localIPs * localIPCache
8988 remoteConfigState dynamicRemoteConfigState
9089}
@@ -134,8 +133,7 @@ func newNpCollectorImpl(epForwarder eventplatform.Forwarder, collectorConfigs *c
134133 flushLoopDone : make (chan struct {}),
135134 workersDone : make (chan struct {}),
136135
137- filter : filter ,
138- localFilter : filter ,
136+ filter : filter ,
139137 }
140138}
141139
@@ -214,7 +212,7 @@ type pathEvaluation struct {
214212 tags []string
215213}
216214
217- func (s * npCollectorImpl ) evaluateNetworkPathForConn (conn npmodel.NetworkPathConnection , origin payload.PathOrigin , vpcSubnets []netip.Prefix , baselineMode bool ) pathEvaluation {
215+ func (s * npCollectorImpl ) evaluateNetworkPathForConn (conn npmodel.NetworkPathConnection , origin payload.PathOrigin , vpcSubnets []netip.Prefix ) pathEvaluation {
218216 if conn .IntraHost {
219217 _ = s .statsdClient .Incr (netpathConnsSkippedMetricName , []string {"reason:skip_intra_host" }, 1 )
220218 return pathEvaluation {}
@@ -243,18 +241,9 @@ func (s *npCollectorImpl) evaluateNetworkPathForConn(conn npmodel.NetworkPathCon
243241 return pathEvaluation {}
244242 }
245243
246- var included bool
247- var testConfigID string
248- var tags []string
249- if baselineMode {
250- // Dynamic Remote Configuration admits standard tests only. Baseline
251- // selection must remain governed by built-in and local filters.
252- included , testConfigID , tags = s .localFilter .EvaluateWithTags (conn .Domain , conn .Dest .Addr ())
253- } else {
254- s .filterMutex .RLock ()
255- included , testConfigID , tags = s .filter .EvaluateWithTags (conn .Domain , conn .Dest .Addr ())
256- s .filterMutex .RUnlock ()
257- }
244+ s .filterMutex .RLock ()
245+ included , testConfigID , tags := s .filter .EvaluateWithTags (conn .Domain , conn .Dest .Addr ())
246+ s .filterMutex .RUnlock ()
258247 if ! included {
259248 _ = s .statsdClient .Incr (netpathConnsSkippedMetricName , []string {"reason:skip_not_matched_by_filters" }, 1 )
260249 return pathEvaluation {}
@@ -334,18 +323,23 @@ func (s *npCollectorImpl) scheduleNetworkPathTests(origin payload.PathOrigin, co
334323 }
335324 for conn := range conns {
336325 connCount ++
337- evaluation := s .evaluateNetworkPathForConn (conn , origin , vpcSubnets , baselineMode )
326+ evaluation := s .evaluateNetworkPathForConn (conn , origin , vpcSubnets )
338327 if ! evaluation .shouldSchedule {
339328 s .logger .Tracef ("Skipped connection: addr=%s, protocol=%s" , conn .Dest , conn .Type )
340329 continue
341330 }
342331 pathtest := s .makePathtest (conn , origin )
332+ pathtest .TestConfigID = evaluation .testConfigID
333+ pathtest .Tags = evaluation .tags
334+ if evaluation .testConfigID != "" {
335+ pathtest .TestConfigSource = payload .TestConfigSourceRemote
336+ }
343337 if baselineMode {
344338 selectedBaselineCandidates = addBaselinePath (selectedBaselineCandidates , pathtest , conn .Signals )
345339 continue
346340 }
347341
348- if err := s .scheduleStandardNetworkPathTest ( pathtest , evaluation ); err != nil {
342+ if err := s .scheduleOne ( & pathtest ); err != nil {
349343 s .logger .Errorf ("Error scheduling pathtests: %s" , err )
350344 }
351345 }
@@ -355,16 +349,6 @@ func (s *npCollectorImpl) scheduleNetworkPathTests(origin payload.PathOrigin, co
355349 _ = s .statsdClient .Count (common .NetworkPathCollectorMetricPrefix + "schedule.conns_received" , int64 (connCount ), []string {}, 1 )
356350 _ = s .statsdClient .Gauge (common .NetworkPathCollectorMetricPrefix + "schedule.duration" , s .TimeNowFn ().Sub (startTime ).Seconds (), nil , 1 )
357351}
358-
359- func (s * npCollectorImpl ) scheduleStandardNetworkPathTest (pathtest common.Pathtest , evaluation pathEvaluation ) error {
360- pathtest .TestConfigID = evaluation .testConfigID
361- pathtest .Tags = evaluation .tags
362- if evaluation .testConfigID != "" {
363- pathtest .TestConfigSource = payload .TestConfigSourceRemote
364- }
365- return s .scheduleOne (& pathtest )
366- }
367-
368352func (s * npCollectorImpl ) scheduleBaselinePaths (selected []baselineCandidate ) {
369353 for i := range selected {
370354 if err := s .scheduleOne (& selected [i ].path ); err != nil {
0 commit comments