You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/10/13 13:23:11 UTC

[skywalking-data-collect-protocol] branch master updated: Support SpanAttachedEvent (#77)

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

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-data-collect-protocol.git


The following commit(s) were added to refs/heads/master by this push:
     new 3dc973f  Support SpanAttachedEvent (#77)
3dc973f is described below

commit 3dc973f859e4dab9521bac7f5d2ede2c4f57c524
Author: 吴晟 Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Oct 13 21:23:06 2022 +0800

    Support SpanAttachedEvent (#77)
---
 common/Common.proto          | 20 +++++++++++++++
 language-agent/Tracing.proto | 59 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/common/Common.proto b/common/Common.proto
index 3ad837e..5df1d43 100644
--- a/common/Common.proto
+++ b/common/Common.proto
@@ -30,6 +30,13 @@ message KeyStringValuePair {
     string value = 2;
 }
 
+// since v3.1
+// An extension of KeyStringValuePair represents a kind of metric value for the key.
+message KeyIntValuePair {
+    string key = 1;
+    int64 value = 2;
+}
+
 message CPU {
     double usagePercent = 2;
 }
@@ -52,3 +59,16 @@ message Command {
     repeated KeyStringValuePair args = 2;
 }
 
+// since v3.1
+// An instantaneous point on the time-line.
+// An instant represents a data point accurate to the nanosecond.
+// It is constituted by a long representing epoch-seconds and an int representing nanosecond-of-second,
+// which will always be between 0 and 999,999,999
+message Instant {
+    // The number of seconds from the epoch of 1970-01-01T00:00:00Z.
+    int64 seconds = 1;
+    // The number of nanoseconds, later along the time-line, from the seconds field.
+    // This is always positive, and never exceeds 999,999,999.
+    int32 nanos = 2;
+}
+
diff --git a/language-agent/Tracing.proto b/language-agent/Tracing.proto
index 568dff6..53dfbe6 100644
--- a/language-agent/Tracing.proto
+++ b/language-agent/Tracing.proto
@@ -223,3 +223,62 @@ enum SpanLayer {
 message SegmentCollection {
     repeated SegmentObject segments = 1;
 }
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// ebpf agent(SkyWalking Rover) collects extra information from the OS(Linux Only) level to attach on the traced span.
+// Since v3.1
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+service SpanAttachedEventReportService {
+    // Collect SpanAttachedEvent to the OAP server in the streaming mode.
+    rpc collect (stream SpanAttachedEvent) returns (Commands) {
+    }
+}
+
+// SpanAttachedEvent represents an attached event for a traced RPC.
+//
+// When an RPC is being traced by the in-process language agent, a span would be reported by the client-side agent.
+// And the rover would be aware of this RPC due to the existing tracing header.
+// Then, the rover agent collects extra information from the OS level to provide assistance information to diagnose network performance.
+message SpanAttachedEvent {
+    // The nanosecond timestamp of the event's start time.
+    // Notice, most unit of timestamp in SkyWalking is milliseconds, but NANO-SECOND is required here.
+    // Because the attached event happens in the OS syscall level, most of them are executed rapidly.
+    Instant startTime = 1;
+    // The official event name.
+    // For example, the event name is a method signature from syscall stack.
+    string event = 2;
+    // [Optional] The nanosecond timestamp of the event's end time.
+    Instant endTime = 3;
+    // The tags for this event includes some extra OS level information,
+    // such as
+    // 1. net_device used for this exit span.
+    // 2. network L7 protocol
+    repeated KeyStringValuePair tags = 4;
+    // The summary of statistics during this event.
+    // Each statistic provides a name(metric name) to represent the name, and an int64/long as the value.
+    repeated KeyIntValuePair summary = 5;
+    // Refer to a trace context decoded from `sw8` header through network, such as HTTP header, MQ metadata
+    // https://skywalking.apache.org/docs/main/next/en/protocols/skywalking-cross-process-propagation-headers-protocol-v3/#standard-header-item
+    SpanReference traceContext = 6;
+
+    message SpanReference {
+        SpanReferenceType type = 1;
+        // [Optional] A string id represents the whole trace.
+        string traceId = 2;
+        // A unique id represents this segment. Other segments could use this id to reference as a child segment.
+        // [Optional] when this span reference
+        string traceSegmentId = 3;
+        // If type == SKYWALKING
+        // The number id of the span. Should be unique in the whole segment.
+        // Starting at 0
+        //
+        // If type == ZIPKIN
+        // The type of span ID is string.
+        string spanId = 4;
+    }
+
+    enum SpanReferenceType {
+        SKYWALKING = 0;
+        ZIPKIN = 1;
+    }
+}
\ No newline at end of file