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/incubator-skywalking-data-collect-protocol.git
The following commit(s) were added to refs/heads/master by this push:
new 9f145f8 CC @peng-yongsheng @hanahmily the v2.0 protocol draft
9f145f8 is described below
commit 9f145f80342f5cd28e5764b302d7e2e33bd00891
Author: Wu Sheng <[email protected]>
AuthorDate: Thu Aug 16 15:29:08 2018 +0800
CC @peng-yongsheng @hanahmily the v2.0 protocol draft
---
.../service-mesh.proto => common/common.proto | 40 +++--------
register/Register.proto | 84 ++++++++++++++++++++++
service-mesh-probe/service-mesh.proto | 8 +--
3 files changed, 97 insertions(+), 35 deletions(-)
diff --git a/service-mesh-probe/service-mesh.proto b/common/common.proto
similarity index 54%
copy from service-mesh-probe/service-mesh.proto
copy to common/common.proto
index 5021b71..5135091 100644
--- a/service-mesh-probe/service-mesh.proto
+++ b/common/common.proto
@@ -19,42 +19,24 @@
syntax = "proto3";
option java_multiple_files = true;
-option java_package = "org.apache.skywalking.apm.network.servicemesh";
+option java_package = "org.apache.skywalking.apm.network.common";
+option csharp_namespace = "SkyWalking.NetworkProtocol";
-service ServiceMeshMetricService {
- rpc collect(stream ServiceMeshMetric) returns (MeshProbeDownstream) {
- }
+message KeyStringValuePair {
+ string key = 1;
+ string value = 2;
}
-message ServiceMeshMetric {
- int64 startTime = 1;
- int64 endTime = 2;
- string sourceServiceName = 3;
- int32 sourceServiceId = 4;
- string sourceServiceInstance = 5;
- int32 sourceServiceInstanceId = 6;
- string destServiceName = 7;
- int32 destServiceId = 8;
- string destServiceInstance = 9;
- int32 destServiceInstanceId = 10;
- string endpoint = 11;
- int32 latency = 12;
- int32 responseCode = 13;
- bool status = 14;
- Protocol protocol = 15;
- DetectPoint detectPoint = 16;
-}
-
-enum Protocol {
- HTTP = 0;
- gRPC = 1;
+message KeyIntValuePair {
+ string key = 1;
+ int32 value = 2;
}
+// In most cases, detect point should be `server` or `client`.
+// Even in service mesh, this means `server`/`client` side sidecar
+// `proxy` is reserved only.
enum DetectPoint {
client = 0;
server = 1;
proxy = 2;
}
-
-message MeshProbeDownstream {
-}
diff --git a/register/Register.proto b/register/Register.proto
new file mode 100644
index 0000000..39c2afc
--- /dev/null
+++ b/register/Register.proto
@@ -0,0 +1,84 @@
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.skywalking.apm.network.register";
+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 (Enpoints) returns (EndpointMapping) {
+ }
+
+ rpc doNetworkAddressRegister (NetAddresses) returns (NetAddressMapping) {
+ }
+}
+
+// Service register
+message Services {
+ repeated Service services = 1;
+}
+
+message Service {
+ string serviceName = 1;
+ repeated KeyStringValuePair tags = 3;
+ repeated KeyStringValuePair properties = 4;
+}
+
+message ServiceRegisterMapping {
+ repeated KeyIntValuePair services = 1;
+}
+
+// Service Instance register
+message ServiceInstances {
+ repeated ServiceInstance instances = 1;
+}
+
+message ServiceInstance {
+ int32 serviceId = 1;
+ string instanceUUID = 2;
+ repeated KeyStringValuePair tags = 3;
+ repeated KeyStringValuePair properties = 4;
+}
+
+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;
+}
+
+// Endpint register
+message Enpoints {
+ 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 KeyIntValuePair endpoints = 1;
+}
diff --git a/service-mesh-probe/service-mesh.proto
b/service-mesh-probe/service-mesh.proto
index 5021b71..87e0b70 100644
--- a/service-mesh-probe/service-mesh.proto
+++ b/service-mesh-probe/service-mesh.proto
@@ -21,6 +21,8 @@ syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.servicemesh";
+import "common/common.proto";
+
service ServiceMeshMetricService {
rpc collect(stream ServiceMeshMetric) returns (MeshProbeDownstream) {
}
@@ -50,11 +52,5 @@ enum Protocol {
gRPC = 1;
}
-enum DetectPoint {
- client = 0;
- server = 1;
- proxy = 2;
-}
-
message MeshProbeDownstream {
}