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 35258c4  Change attached event names in network profiling (#62)
35258c4 is described below

commit 35258c492b01a583d59e6660ba840b9cd03590f2
Author: mrproliu <[email protected]>
AuthorDate: Thu Dec 1 18:25:57 2022 +0800

    Change attached event names in network profiling (#62)
    
    * Change attached event names
    
    * Trying to lock the GHA machine version to fix CI
---
 .github/workflows/rover.yaml                        |  4 ++--
 pkg/profiling/task/network/analyze/base/enums.go    |  4 ++--
 .../analyze/layer7/protocols/http1/metrics.go       | 21 ++++++++-------------
 .../profiling/network/expected/skywalking-trace.yml |  2 +-
 4 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/rover.yaml b/.github/workflows/rover.yaml
index 8ac40f4..e43c120 100644
--- a/.github/workflows/rover.yaml
+++ b/.github/workflows/rover.yaml
@@ -69,7 +69,7 @@ jobs:
   e2e-test:
     name: E2E test
     needs: [ docker ]
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     timeout-minutes: 60
     strategy:
       fail-fast: false
@@ -142,7 +142,7 @@ jobs:
   https-e2e-test:
     name: HTTPS E2E test
     needs: [ docker ]
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     timeout-minutes: 60
     strategy:
       fail-fast: false
diff --git a/pkg/profiling/task/network/analyze/base/enums.go 
b/pkg/profiling/task/network/analyze/base/enums.go
index 95f6bba..0cda9d7 100644
--- a/pkg/profiling/task/network/analyze/base/enums.go
+++ b/pkg/profiling/task/network/analyze/base/enums.go
@@ -65,9 +65,9 @@ const (
 func (d SocketDataDirection) String() string {
        switch d {
        case SocketDataDirectionIngress:
-               return "ingress"
+               return "inbound"
        case SocketDataDirectionEgress:
-               return "egress"
+               return "outbound"
        default:
                return unknown
        }
diff --git 
a/pkg/profiling/task/network/analyze/layer7/protocols/http1/metrics.go 
b/pkg/profiling/task/network/analyze/layer7/protocols/http1/metrics.go
index 7053216..334dcea 100644
--- a/pkg/profiling/task/network/analyze/layer7/protocols/http1/metrics.go
+++ b/pkg/profiling/task/network/analyze/layer7/protocols/http1/metrics.go
@@ -262,23 +262,18 @@ func (h *Trace) appendHTTPEvent(events 
[]*v3.SpanAttachedEvent, process api.Proc
        event.Tags = make([]*commonv3.KeyStringValuePair, 0)
        event.Tags = append(event.Tags,
                // content data
-               &commonv3.KeyStringValuePair{Key: "data size", Value: 
units.BytesSize(float64(buffer.TotalSize()))},
-               &commonv3.KeyStringValuePair{Key: "data content", Value: 
content},
-               &commonv3.KeyStringValuePair{Key: "data direction", Value: 
buffer.Direction().String()},
-               &commonv3.KeyStringValuePair{Key: "data type", Value: tp},
+               &commonv3.KeyStringValuePair{Key: "data_size", Value: 
units.BytesSize(float64(buffer.TotalSize()))},
+               &commonv3.KeyStringValuePair{Key: "data_content", Value: 
content},
+               &commonv3.KeyStringValuePair{Key: "data_direction", Value: 
buffer.Direction().String()},
+               &commonv3.KeyStringValuePair{Key: "data_type", Value: 
strings.ToLower(tp)},
                // connection
-               &commonv3.KeyStringValuePair{Key: "connection role", Value: 
traffic.Role.String()},
+               &commonv3.KeyStringValuePair{Key: "connection_role", Value: 
traffic.Role.String()},
                // entity
-               &commonv3.KeyStringValuePair{Key: "service name", Value: 
process.Entity().ServiceName},
-               &commonv3.KeyStringValuePair{Key: "service instance name", 
Value: process.Entity().InstanceName},
-               &commonv3.KeyStringValuePair{Key: "process name", Value: 
process.Entity().ProcessName},
+               &commonv3.KeyStringValuePair{Key: "service_name", Value: 
process.Entity().ServiceName},
+               &commonv3.KeyStringValuePair{Key: "service_instance_name", 
Value: process.Entity().InstanceName},
+               &commonv3.KeyStringValuePair{Key: "process_name", Value: 
process.Entity().ProcessName},
        )
 
-       // current event needs bind to the upstream
-       if buffer.Direction() == base.SocketDataDirectionIngress && tp == 
transportRequest ||
-               buffer.Direction() == base.SocketDataDirectionEgress && tp == 
transportResponse {
-               event.Tags = append(event.Tags, 
&commonv3.KeyStringValuePair{Key: "bind to upstream span", Value: "true"})
-       }
        event.Summary = make([]*commonv3.KeyIntValuePair, 0)
        event.TraceContext = &v3.SpanAttachedEvent_SpanReference{
                TraceId:        h.Trace.TraceID(),
diff --git a/test/e2e/cases/profiling/network/expected/skywalking-trace.yml 
b/test/e2e/cases/profiling/network/expected/skywalking-trace.yml
index 0ee677b..3178cc2 100644
--- a/test/e2e/cases/profiling/network/expected/skywalking-trace.yml
+++ b/test/e2e/cases/profiling/network/expected/skywalking-trace.yml
@@ -44,7 +44,7 @@ spans:
       summary: []
       tags:
       {{- contains .tags }}
-      - key: data size
+      - key: data_size
         value: {{ notEmpty .value }}
       {{- end }}
   {{- end }}

Reply via email to