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 2020/03/31 06:01:03 UTC
[skywalking-data-collect-protocol] 01/03: New v3 protocol
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch v3-proto
in repository https://gitbox.apache.org/repos/asf/skywalking-data-collect-protocol.git
commit dd5bd1c71afef6450a4942c2b3f1669a2c6277de
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Tue Mar 31 13:37:55 2020 +0800
New v3 protocol
---
browser/BrowserPerf.proto | 2 +-
common/{common.proto => Common.proto} | 5 -
common/trace-common.proto | 52 ---------
language-agent-v2/CLRMetric.proto | 36 ------
language-agent-v2/JVMMetric.proto | 36 ------
common/CLR.proto => language-agent/CLRMetric.proto | 14 ++-
common/JVM.proto => language-agent/JVMMetric.proto | 18 ++-
.../trace.proto => language-agent/Tracing.proto | 81 ++++++++-----
.../Management.proto | 25 ++--
profile/Profile.proto | 5 +-
register/Register.proto | 127 ---------------------
service-mesh-probe/istio/skywalking.config.pb.html | 39 -------
service-mesh-probe/service-mesh.proto | 2 +-
13 files changed, 98 insertions(+), 344 deletions(-)
diff --git a/browser/BrowserPerf.proto b/browser/BrowserPerf.proto
index b2729f2..c0693ca 100644
--- a/browser/BrowserPerf.proto
+++ b/browser/BrowserPerf.proto
@@ -21,7 +21,7 @@ syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
-import "common/common.proto";
+import "common/Common.proto";
// Collect performance raw data from browser.
service BrowserPerfService {
diff --git a/common/common.proto b/common/Common.proto
similarity index 96%
rename from common/common.proto
rename to common/Common.proto
index a64394d..a1f7c1d 100644
--- a/common/common.proto
+++ b/common/Common.proto
@@ -27,11 +27,6 @@ message KeyStringValuePair {
string value = 2;
}
-message KeyIntValuePair {
- string key = 1;
- int32 value = 2;
-}
-
message CPU {
double usagePercent = 2;
}
diff --git a/common/trace-common.proto b/common/trace-common.proto
deleted file mode 100644
index dcbe03d..0000000
--- a/common/trace-common.proto
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.language.agent";
-option csharp_namespace = "SkyWalking.NetworkProtocol";
-
-message UpstreamSegment {
- repeated UniqueId globalTraceIds = 1;
- bytes segment = 2; // the byte array of TraceSegmentObject
-}
-
-enum SpanType {
- Entry = 0;
- Exit = 1;
- Local = 2;
-}
-
-message UniqueId {
- repeated int64 idParts = 1;
-}
-
-enum RefType {
- CrossProcess = 0;
- CrossThread = 1;
-}
-
-enum SpanLayer {
- Unknown = 0;
- Database = 1;
- RPCFramework = 2;
- Http = 3;
- MQ = 4;
- Cache = 5;
-}
diff --git a/language-agent-v2/CLRMetric.proto b/language-agent-v2/CLRMetric.proto
deleted file mode 100644
index da023b6..0000000
--- a/language-agent-v2/CLRMetric.proto
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.language.agent.v2";
-option csharp_namespace = "SkyWalking.NetworkProtocol";
-
-import "common/common.proto";
-import "common/CLR.proto";
-
-service CLRMetricReportService {
- rpc collect (CLRMetricCollection) returns (Commands) {
- }
-}
-
-message CLRMetricCollection {
- repeated CLRMetric metrics = 1;
- int32 serviceInstanceId = 2;
-}
\ No newline at end of file
diff --git a/language-agent-v2/JVMMetric.proto b/language-agent-v2/JVMMetric.proto
deleted file mode 100644
index 845624c..0000000
--- a/language-agent-v2/JVMMetric.proto
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.language.agent.v2";
-option csharp_namespace = "SkyWalking.NetworkProtocol";
-
-import "common/common.proto";
-import "common/JVM.proto";
-
-service JVMMetricReportService {
- rpc collect (JVMMetricCollection) returns (Commands) {
- }
-}
-
-message JVMMetricCollection {
- repeated JVMMetric metrics = 1;
- int32 serviceInstanceId = 2;
-}
diff --git a/common/CLR.proto b/language-agent/CLRMetric.proto
similarity index 85%
rename from common/CLR.proto
rename to language-agent/CLRMetric.proto
index 57bc860..ccbfabf 100644
--- a/common/CLR.proto
+++ b/language-agent/CLRMetric.proto
@@ -19,10 +19,20 @@
syntax = "proto3";
option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.language.agent";
+option java_package = "org.apache.skywalking.apm.network.language.agent.v3";
option csharp_namespace = "SkyWalking.NetworkProtocol";
-import "common/common.proto";
+import "common/Common.proto";
+
+service CLRMetricReportService {
+ rpc collect (CLRMetricCollection) returns (Commands) {
+ }
+}
+
+message CLRMetricCollection {
+ repeated CLRMetric metrics = 1;
+ int32 serviceInstanceId = 2;
+}
message CLRMetric {
int64 time = 1;
diff --git a/common/JVM.proto b/language-agent/JVMMetric.proto
similarity index 84%
rename from common/JVM.proto
rename to language-agent/JVMMetric.proto
index 543c640..a7e86a3 100644
--- a/common/JVM.proto
+++ b/language-agent/JVMMetric.proto
@@ -19,10 +19,21 @@
syntax = "proto3";
option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.language.agent";
+option java_package = "org.apache.skywalking.apm.network.language.agent.v3";
option csharp_namespace = "SkyWalking.NetworkProtocol";
-import "common/common.proto";
+import "common/Common.proto";
+
+service JVMMetricReportService {
+ rpc collect (JVMMetricCollection) returns (Commands) {
+ }
+}
+
+message JVMMetricCollection {
+ repeated JVMMetric metrics = 1;
+ string service = 2;
+ string serviceInstance = 3;
+}
message JVMMetric {
int64 time = 1;
@@ -45,7 +56,7 @@ message MemoryPool {
int64 init = 2;
int64 max = 3;
int64 used = 4;
- int64 commited = 5;
+ int64 committed = 5;
}
enum PoolType {
@@ -67,3 +78,4 @@ enum GCPhrase {
NEW = 0;
OLD = 1;
}
+
diff --git a/language-agent-v2/trace.proto b/language-agent/Tracing.proto
similarity index 55%
rename from language-agent-v2/trace.proto
rename to language-agent/Tracing.proto
index c6120c5..149235e 100644
--- a/language-agent-v2/trace.proto
+++ b/language-agent/Tracing.proto
@@ -19,59 +19,78 @@
syntax = "proto3";
option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.language.agent.v2";
+option java_package = "org.apache.skywalking.apm.network.language.agent.v3";
option csharp_namespace = "SkyWalking.NetworkProtocol";
-import "common/common.proto";
-import "common/trace-common.proto";
+import "common/Common.proto";
service TraceSegmentReportService {
- rpc collect (stream UpstreamSegment) returns (Commands) {
+ rpc collect (stream SegmentObject) returns (Commands) {
}
}
message SegmentObject {
- UniqueId traceSegmentId = 1;
- repeated SpanObjectV2 spans = 2;
- int32 serviceId = 3;
- int32 serviceInstanceId = 4;
- bool isSizeLimited = 5;
+ string traceId = 1;
+ string traceSegmentId = 2;
+ repeated SpanObject spans = 3;
+ string service = 4;
+ string serviceInstance = 5;
+ bool isSizeLimited = 6;
}
message SegmentReference {
RefType refType = 1;
- UniqueId parentTraceSegmentId = 2;
- int32 parentSpanId = 3;
- int32 parentServiceInstanceId = 4;
- string networkAddress = 5;
- int32 networkAddressId = 6;
- int32 entryServiceInstanceId = 7;
- string entryEndpoint = 8;
- int32 entryEndpointId = 9;
- string parentEndpoint = 10;
- int32 parentEndpointId = 11;
+ string traceId = 2;
+ string parentTraceSegmentId = 3;
+ int32 parentSpanId = 4;
+ string parentService = 5;
+ string parentServiceInstance = 6;
+ string parentEndpoint = 7;
+ string networkAddressUsedAtPeer = 8;
}
-message SpanObjectV2 {
+message SpanObject {
int32 spanId = 1;
int32 parentSpanId = 2;
int64 startTime = 3;
int64 endTime = 4;
repeated SegmentReference refs = 5;
- int32 operationNameId = 6;
- string operationName = 7;
- int32 peerId = 8;
- string peer = 9;
- SpanType spanType = 10;
- SpanLayer spanLayer = 11;
- int32 componentId = 12;
- string component = 13;
- bool isError = 14;
- repeated KeyStringValuePair tags = 15;
- repeated Log logs = 16;
+ string operationName = 6;
+ string peer = 7;
+ SpanType spanType = 8;
+ SpanLayer spanLayer = 9;
+ int32 componentId = 10;
+ string component = 11;
+ bool isError = 12;
+ repeated KeyStringValuePair tags = 13;
+ repeated Log logs = 14;
}
message Log {
int64 time = 1;
repeated KeyStringValuePair data = 2;
}
+
+enum SpanType {
+ Entry = 0;
+ Exit = 1;
+ Local = 2;
+}
+
+message ID {
+ repeated string id = 1;
+}
+
+enum RefType {
+ CrossProcess = 0;
+ CrossThread = 1;
+}
+
+enum SpanLayer {
+ Unknown = 0;
+ Database = 1;
+ RPCFramework = 2;
+ Http = 3;
+ MQ = 4;
+ Cache = 5;
+}
\ No newline at end of file
diff --git a/register/InstancePing.proto b/management/Management.proto
similarity index 65%
rename from register/InstancePing.proto
rename to management/Management.proto
index 3a8ffe1..d22de66 100644
--- a/register/InstancePing.proto
+++ b/management/Management.proto
@@ -19,18 +19,27 @@
syntax = "proto3";
option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.register.v2";
+option java_package = "org.apache.skywalking.apm.network.management.v3";
option csharp_namespace = "SkyWalking.NetworkProtocol";
-import "common/common.proto";
+import "common/Common.proto";
+
+service ManagementService {
+ rpc reportInstanceProperties (InstanceProperties) returns (Commands) {
+ }
+
+ rpc keepAlive (InstancePingPkg) returns (Commands) {
-service ServiceInstancePing {
- rpc doPing (ServiceInstancePingPkg) returns (Commands) {
}
}
-message ServiceInstancePingPkg {
- int32 serviceInstanceId = 1;
- int64 time = 2;
- string serviceInstanceUUID = 3;
+message InstanceProperties {
+ string service = 1;
+ string serviceInstance = 2;
+ repeated KeyStringValuePair properties = 3;
}
+
+message InstancePingPkg {
+ string service = 1;
+ string serviceInstance = 2;
+}
\ No newline at end of file
diff --git a/profile/Profile.proto b/profile/Profile.proto
index 621f58e..3da1b41 100644
--- a/profile/Profile.proto
+++ b/profile/Profile.proto
@@ -22,8 +22,7 @@ option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.profile";
option csharp_namespace = "SkyWalking.NetworkProtocol";
-import "common/common.proto";
-import "common/trace-common.proto";
+import "common/Common.proto";
service ProfileTask {
@@ -55,7 +54,7 @@ message ThreadSnapshot {
// profile task id
string taskId = 1;
// dumped segment id
- UniqueId traceSegmentId = 2;
+ string traceSegmentId = 2;
// dump timestamp
int64 time = 3;
// snapshot dump sequence, start with zero
diff --git a/register/Register.proto b/register/Register.proto
deleted file mode 100644
index 858c5b4..0000000
--- a/register/Register.proto
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.register.v2";
-option csharp_namespace = "SkyWalking.NetworkProtocol";
-
-import "common/common.proto";
-
-//register service for ApplicationCode, this service is called when service starts.
-service Register {
- rpc doServiceRegister (Services) returns (ServiceRegisterMapping) {
- }
-
- rpc doServiceInstanceRegister (ServiceInstances) returns (ServiceInstanceRegisterMapping) {
- }
-
- rpc doEndpointRegister (Endpoints) returns (EndpointMapping) {
- }
-
- rpc doNetworkAddressRegister (NetAddresses) returns (NetAddressMapping) {
- }
-
- rpc doServiceAndNetworkAddressMappingRegister (ServiceAndNetworkAddressMappings) returns(Commands) {
- }
-}
-
-// Service register
-message Services {
- repeated Service services = 1;
-}
-
-message Service {
- string serviceName = 1;
- repeated KeyStringValuePair tags = 3;
- repeated KeyStringValuePair properties = 4;
- // Type of this register service.
- // NULL means type=normal, such as all services before the 7.0.0.
- ServiceType type = 5;
-}
-
-message ServiceRegisterMapping {
- repeated KeyIntValuePair services = 1;
-}
-
-// Service Instance register
-message ServiceInstances {
- repeated ServiceInstance instances = 1;
-}
-
-message ServiceInstance {
- int32 serviceId = 1;
- string instanceUUID = 2;
- int64 time = 3;
- repeated KeyStringValuePair tags = 4;
- repeated KeyStringValuePair properties = 5;
-}
-
-message ServiceInstanceRegisterMapping {
- repeated KeyIntValuePair serviceInstances = 1;
-}
-
-// Network address register
-
-// Only known use case is the language agent.
-// Network address represents the ip/hostname:port, which is usually used at client side of RPC.
-message NetAddresses {
- repeated string addresses = 1;
-}
-
-message NetAddressMapping {
- repeated KeyIntValuePair addressIds = 1;
-}
-
-// Endpoints register
-message Endpoints {
- repeated Endpoint endpoints = 1;
-}
-
-message Endpoint {
- int32 serviceId = 1;
- string endpointName = 2;
- repeated KeyStringValuePair tags = 3;
- repeated KeyStringValuePair properties = 4;
- // For endpoint
- // from DetectPoint is either `client` or `server`. No chance to be `proxy`.
- DetectPoint from = 5;
-}
-
-message EndpointMapping {
- repeated EndpointMappingElement elements = 1;
-}
-
-message EndpointMappingElement {
- int32 serviceId = 1;
- string endpointName = 2;
- int32 endpointId = 3;
- DetectPoint from = 4;
-}
-
-message ServiceAndNetworkAddressMappings {
- repeated ServiceAndNetworkAddressMapping mappings = 1;
-}
-
-message ServiceAndNetworkAddressMapping {
- int32 serviceId = 1;
- int32 serviceInstanceId = 2;
- string networkAddress = 3;
- int32 networkAddressId = 4;
-}
diff --git a/service-mesh-probe/istio/skywalking.config.pb.html b/service-mesh-probe/istio/skywalking.config.pb.html
deleted file mode 100644
index a92c804..0000000
--- a/service-mesh-probe/istio/skywalking.config.pb.html
+++ /dev/null
@@ -1,39 +0,0 @@
----
-title: Apache SkyWalking
-description: Adapter to deliver metrics to Apache SkyWalking.
-location: https://istio.io/docs/reference/config/policy-and-telemetry/adapters/apache-skywalking.html
-layout: protoc-gen-docs
-generator: protoc-gen-docs
-provider: Apache SkyWalking
-contact_email: dev@skywalking.apache.org
-support_link:
-source_link: https://github.com/apache/skywalking
-latest_release_link: https://skywalking.apache.org/downloads/
-helm_chart_link:
-istio_versions: "1.0.3, 1.0.4, 1.1.0, 1.1.1"
-supported_templates: metric
-logo_link: https://github.com/apache/skywalking-website/raw/master/docs/.vuepress/public/assets/logo.svg
-number_of_entries: 1
----
-
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License. -->
-
-<p>The SkyWalking adapter uses the <code>Istio bypass</code> adapter to collect metrics and make them available to
-<a href="https://skywalking.apache.org/">Apache SkyWalking</a>. SkyWalking provides a topology map and metrics graph
-to visualize the whole mesh.</p>
-
-<p>This adapter supports the <a href="https://istio.io/docs/reference/config/policy-and-telemetry/templates/metric/">metric template</a>.</p>
-
-<p>Follow the <a href="https://github.com/apache/skywalking/blob/master/docs/README.md">official Apache SkyWalking documentation</a>
-and <a href="https://github.com/apache/skywalking-kubernetes">SkyWalking k8s documentation</a> for details on configuring SkyWalking and the Istio bypass adapter.</p>
diff --git a/service-mesh-probe/service-mesh.proto b/service-mesh-probe/service-mesh.proto
index 87e0b70..78af44b 100644
--- a/service-mesh-probe/service-mesh.proto
+++ b/service-mesh-probe/service-mesh.proto
@@ -21,7 +21,7 @@ syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.servicemesh";
-import "common/common.proto";
+import "common/Common.proto";
service ServiceMeshMetricService {
rpc collect(stream ServiceMeshMetric) returns (MeshProbeDownstream) {