This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch reduce-handle-connect-time
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git
The following commit(s) were added to refs/heads/reduce-handle-connect-time by
this push:
new ad6adf1 add conntrack new probes
ad6adf1 is described below
commit ad6adf1d29400f67d1e0cefa4b3f43c53f009b0f
Author: mrproliu <[email protected]>
AuthorDate: Fri Dec 27 21:42:53 2024 +0800
add conntrack new probes
---
pkg/tools/ip/conntrack.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pkg/tools/ip/conntrack.go b/pkg/tools/ip/conntrack.go
index 72dc1b9..2ba0fb6 100644
--- a/pkg/tools/ip/conntrack.go
+++ b/pkg/tools/ip/conntrack.go
@@ -18,6 +18,7 @@
package ip
import (
+ "context"
"net"
"syscall"
@@ -47,6 +48,12 @@ func NewConnTrack() (*ConnTrack, error) {
if err != nil {
return nil, err
}
+ go func() {
+ nfct.RegisterFiltered(context.Background(),
conntrack.Conntrack, conntrack.NetlinkCtNew|conntrack.NetlinkCtUpdate, nil,
func(event conntrack.Con) int {
+ log.Infof("conntrack event: %+v", event)
+ return 0
+ })
+ }()
return &ConnTrack{tracker: nfct}, nil
}