This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/main by this push:
     new c7d8a13  Adapt the gRPC process protocol (#6)
c7d8a13 is described below

commit c7d8a13fdbaa541f15feefbf519bd66dd840e062
Author: mrproliu <[email protected]>
AuthorDate: Thu Mar 3 18:13:12 2022 +0800

    Adapt the gRPC process protocol (#6)
---
 configs/rover_configs.yaml        | 2 +-
 go.mod                            | 4 ++--
 go.sum                            | 9 +++++----
 pkg/process/finders/storage.go    | 9 +++++++--
 pkg/process/finders/vm/process.go | 2 +-
 5 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/configs/rover_configs.yaml b/configs/rover_configs.yaml
index f46fb82..c462249 100644
--- a/configs/rover_configs.yaml
+++ b/configs/rover_configs.yaml
@@ -49,7 +49,7 @@ process_discovery:
       # If the multiple finders could match the same one process, only the 
first finder could be selected and report
       - match_cmd_regex: ${ROVER_PROCESS_DISCOVERY_VM_FINDER_MATCH_CMD_REGEX:}
         # The Layer need to relate to the process entity
-        layer: ${ROVER_PROCESS_DISCOVERY_VM_FINDER_LAYER:VM}
+        layer: ${ROVER_PROCESS_DISCOVERY_VM_FINDER_LAYER:OS_LINUX}
         # The Service Name need to relate to the process entity
         service_name: ${ROVER_PROCESS_DISCOVERY_VM_FINDER_SERVICE_NAME:}
         # The Service Instance Name need to relate to the process entity
diff --git a/go.mod b/go.mod
index a600bb2..60264ef 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
        github.com/spf13/cobra v1.3.0
        github.com/spf13/viper v1.10.1
        google.golang.org/grpc v1.44.0
-       skywalking.apache.org/repo/goapi v0.0.0-20220228040118-f1aefbfd2a8c
+       skywalking.apache.org/repo/goapi v0.0.0-20220302122002-ea09cd279b0d
 )
 
 require (
@@ -31,7 +31,7 @@ require (
        github.com/tklauser/go-sysconf v0.3.9 // indirect
        github.com/tklauser/numcpus v0.3.0 // indirect
        github.com/yusufpapurcu/wmi v1.2.2 // indirect
-       golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
+       golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
        golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
        golang.org/x/text v0.3.7 // indirect
        google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // 
indirect
diff --git a/go.sum b/go.sum
index ace9634..c5a14db 100644
--- a/go.sum
+++ b/go.sum
@@ -460,8 +460,9 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod 
h1:RBQZq4jEuRlivfhVLd
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod 
h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod 
h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
 golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d 
h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c=
 golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f 
h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
+golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod 
h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod 
h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod 
h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -553,9 +554,9 @@ golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod 
h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod 
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211210111614-af8b64212486 
h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk=
@@ -811,5 +812,5 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod 
h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
 rsc.io/binaryregexp v0.2.0/go.mod 
h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-skywalking.apache.org/repo/goapi v0.0.0-20220228040118-f1aefbfd2a8c 
h1:gf4vxQAHDGBYPpqBsWN5x6+gBCnfzxnI0yPc8acznO8=
-skywalking.apache.org/repo/goapi v0.0.0-20220228040118-f1aefbfd2a8c/go.mod 
h1:4KrWd+Oi4lkB+PtxZgIlf+3T6EECPru4fOWNMEHjxRk=
+skywalking.apache.org/repo/goapi v0.0.0-20220302122002-ea09cd279b0d 
h1:yyLwLgzCQfDt+YmNanaTb/1dLYqR98Skh49E4TNnwUM=
+skywalking.apache.org/repo/goapi v0.0.0-20220302122002-ea09cd279b0d/go.mod 
h1:wzVLZ8F88Idy5tlmcGgJCH2NY8GUWxJ2RuNVXkao+SM=
diff --git a/pkg/process/finders/storage.go b/pkg/process/finders/storage.go
index da9c5c8..754de08 100644
--- a/pkg/process/finders/storage.go
+++ b/pkg/process/finders/storage.go
@@ -132,7 +132,12 @@ func (s *ProcessStorage) 
processesKeepAlive(waitKeepAliveProcess []*ProcessConte
        processIDList := make([]*v3.EBPFProcessPingPkg, 0)
        for _, ps := range waitKeepAliveProcess {
                if ps.id != "" {
-                       processIDList = append(processIDList, 
&v3.EBPFProcessPingPkg{ProcessId: ps.id})
+                       processIDList = append(processIDList, 
&v3.EBPFProcessPingPkg{EntityMetadata: &v3.EBPFProcessEntityMetadata{
+                               Layer:        ps.Entity().Layer,
+                               ServiceName:  ps.Entity().ServiceName,
+                               InstanceName: ps.Entity().InstanceName,
+                               ProcessName:  ps.Entity().ProcessName,
+                       }})
                }
        }
 
@@ -151,7 +156,7 @@ func (s *ProcessStorage) 
processesReport(waitReportProcesses []*ProcessContext)
        for _, ps := range waitReportProcesses {
                properties = append(properties, 
s.finders[ps.DetectType()].BuildEBPFProcess(buildContext, ps.detectProcess))
        }
-       processes, err := s.processClient.ReportProcesses(s.ctx, 
&v3.EBPFProcessReportList{Processes: properties})
+       processes, err := s.processClient.ReportProcesses(s.ctx, 
&v3.EBPFProcessReportList{Processes: properties, EbpfAgentID: s.roverID})
        if err != nil {
                return err
        }
diff --git a/pkg/process/finders/vm/process.go 
b/pkg/process/finders/vm/process.go
index 0973f1a..d6566ce 100644
--- a/pkg/process/finders/vm/process.go
+++ b/pkg/process/finders/vm/process.go
@@ -62,6 +62,6 @@ func (p *Process) OriginalProcess() *process.Process {
 
 // BuildIdentity without pid
 func (p *Process) BuildIdentity() string {
-       return fmt.Sprintf("%s_%s_%s_%s", p.cmd, p.entity.ServiceName,
+       return fmt.Sprintf("%s_%s_%s_%s", p.entity.Layer, p.entity.ServiceName,
                p.entity.InstanceName, p.entity.ProcessName)
 }

Reply via email to