From 53be072c25309af44a58d6765e83e3bd53d2ba21 Mon Sep 17 00:00:00 2001 From: pengys5 <8082209@qq.com> Date: Mon, 3 Jul 2017 12:25:38 +0800 Subject: [PATCH 1/3] change the grpc protocol --- .../proto/ApplicationRegisterService.proto | 20 +++++++++++++++++++ .../src/main/proto/DiscoveryService.proto | 4 ++-- apm-network/src/main/proto/KeyValue.proto | 9 +++++++++ .../src/main/proto/TraceSegmentService.proto | 6 +----- 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 apm-network/src/main/proto/ApplicationRegisterService.proto create mode 100644 apm-network/src/main/proto/KeyValue.proto diff --git a/apm-network/src/main/proto/ApplicationRegisterService.proto b/apm-network/src/main/proto/ApplicationRegisterService.proto new file mode 100644 index 000000000..702cde9fd --- /dev/null +++ b/apm-network/src/main/proto/ApplicationRegisterService.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "org.skywalking.apm.network.trace.proto"; + +import "KeyValue.proto"; + +//register service for ApplicationCode, this service is called when service starts. +service ApplicationRegisterService { + rpc register (Application) returns (ApplicationMapping) { + } +} + +message Application { + repeated string applicationCode = 1; +} + +message ApplicationMapping { + repeated KeyValue application = 1; +} \ No newline at end of file diff --git a/apm-network/src/main/proto/DiscoveryService.proto b/apm-network/src/main/proto/DiscoveryService.proto index e9a986bbe..1f22a0df3 100644 --- a/apm-network/src/main/proto/DiscoveryService.proto +++ b/apm-network/src/main/proto/DiscoveryService.proto @@ -16,7 +16,7 @@ service InstanceDiscoveryService { } message ApplicationInstance { - string applicationCode = 1; + int32 applicationId = 1; } message ApplicationInstanceMapping { @@ -45,6 +45,6 @@ message ServiceNameMappingElement { message ServiceNameElement { string serviceName = 1; - string ApplicationCode = 2; + int32 applicationId = 2; } diff --git a/apm-network/src/main/proto/KeyValue.proto b/apm-network/src/main/proto/KeyValue.proto new file mode 100644 index 000000000..f03132a38 --- /dev/null +++ b/apm-network/src/main/proto/KeyValue.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "org.skywalking.apm.network.collecor.proto"; + +message KeyValue { + string key = 1; + string value = 2; +} diff --git a/apm-network/src/main/proto/TraceSegmentService.proto b/apm-network/src/main/proto/TraceSegmentService.proto index 2134ff219..471cac5a5 100644 --- a/apm-network/src/main/proto/TraceSegmentService.proto +++ b/apm-network/src/main/proto/TraceSegmentService.proto @@ -4,6 +4,7 @@ option java_multiple_files = true; option java_package = "org.skywalking.apm.network.trace.proto"; import "Downstream.proto"; +import "KeyValue.proto"; service TraceSegmentService { rpc collect (stream UpstreamSegment) returns (Downstream) { @@ -65,11 +66,6 @@ enum SpanLayer { MQ = 3; } -message KeyValue { - string key = 1; - string value = 2; -} - message LogMessage { int64 time = 1; repeated KeyValue data = 2; From b97fafc366b8ce99b412078e4c279a3451e82d39 Mon Sep 17 00:00:00 2001 From: pengys5 <8082209@qq.com> Date: Mon, 3 Jul 2017 12:42:42 +0800 Subject: [PATCH 2/3] divide the KeyValue.proto into KeyWithIntegerValue.proto and KeyWithStringValue.proto --- .../proto/ApplicationRegisterService.proto | 4 ++-- .../src/main/proto/KeyWithIntegerValue.proto | 9 +++++++++ .../src/main/proto/KeyWithStringValue.proto | 9 +++++++++ .../src/main/proto/RegisterService.proto | 20 ------------------- .../src/main/proto/TraceSegmentService.proto | 6 +++--- 5 files changed, 23 insertions(+), 25 deletions(-) create mode 100644 apm-network/src/main/proto/KeyWithIntegerValue.proto create mode 100644 apm-network/src/main/proto/KeyWithStringValue.proto delete mode 100644 apm-network/src/main/proto/RegisterService.proto diff --git a/apm-network/src/main/proto/ApplicationRegisterService.proto b/apm-network/src/main/proto/ApplicationRegisterService.proto index 702cde9fd..9c3285d54 100644 --- a/apm-network/src/main/proto/ApplicationRegisterService.proto +++ b/apm-network/src/main/proto/ApplicationRegisterService.proto @@ -3,7 +3,7 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "org.skywalking.apm.network.trace.proto"; -import "KeyValue.proto"; +import "KeyWithIntegerValue.proto"; //register service for ApplicationCode, this service is called when service starts. service ApplicationRegisterService { @@ -16,5 +16,5 @@ message Application { } message ApplicationMapping { - repeated KeyValue application = 1; + repeated KeyWithIntegerValue application = 1; } \ No newline at end of file diff --git a/apm-network/src/main/proto/KeyWithIntegerValue.proto b/apm-network/src/main/proto/KeyWithIntegerValue.proto new file mode 100644 index 000000000..3a0e4e602 --- /dev/null +++ b/apm-network/src/main/proto/KeyWithIntegerValue.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "org.skywalking.apm.network.collecor.proto"; + +message KeyWithIntegerValue { + string key = 1; + int32 value = 2; +} diff --git a/apm-network/src/main/proto/KeyWithStringValue.proto b/apm-network/src/main/proto/KeyWithStringValue.proto new file mode 100644 index 000000000..dabb4d395 --- /dev/null +++ b/apm-network/src/main/proto/KeyWithStringValue.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "org.skywalking.apm.network.collecor.proto"; + +message KeyWithStringValue { + string key = 1; + string value = 2; +} diff --git a/apm-network/src/main/proto/RegisterService.proto b/apm-network/src/main/proto/RegisterService.proto deleted file mode 100644 index 16978439b..000000000 --- a/apm-network/src/main/proto/RegisterService.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.trace.proto"; - -//register service for ApplicationCode, this service is called when service starts. -service ApplicationRegisterService { - rpc register (Application) returns (ApplicationMapping) { - } -} - -message Application { - string applicationCode = 1; -} - -message ApplicationMapping { - int32 applicationId = 1; - Application application = 2; -} - diff --git a/apm-network/src/main/proto/TraceSegmentService.proto b/apm-network/src/main/proto/TraceSegmentService.proto index 471cac5a5..6cfa64929 100644 --- a/apm-network/src/main/proto/TraceSegmentService.proto +++ b/apm-network/src/main/proto/TraceSegmentService.proto @@ -4,7 +4,7 @@ option java_multiple_files = true; option java_package = "org.skywalking.apm.network.trace.proto"; import "Downstream.proto"; -import "KeyValue.proto"; +import "KeyWithStringValue.proto"; service TraceSegmentService { rpc collect (stream UpstreamSegment) returns (Downstream) { @@ -49,7 +49,7 @@ message SpanObject { int32 componentId = 11; string component = 12; bool isError = 13; - repeated KeyValue tags = 14; + repeated KeyWithStringValue tags = 14; repeated LogMessage logs = 15; } @@ -68,5 +68,5 @@ enum SpanLayer { message LogMessage { int64 time = 1; - repeated KeyValue data = 2; + repeated KeyWithStringValue data = 2; } From 5c7e3e674c6664e49489affca49e0760e4e8d292 Mon Sep 17 00:00:00 2001 From: pengys5 <8082209@qq.com> Date: Mon, 3 Jul 2017 12:51:34 +0800 Subject: [PATCH 3/3] delete the sub packages name trace and collector which in the package of org.skywalking.apm.network --- .../src/main/proto/ApplicationRegisterService.proto | 2 +- apm-network/src/main/proto/DiscoveryService.proto | 2 +- apm-network/src/main/proto/Downstream.proto | 2 +- apm-network/src/main/proto/JVMMetricsService.proto | 2 +- apm-network/src/main/proto/KeyValue.proto | 9 --------- apm-network/src/main/proto/KeyWithIntegerValue.proto | 2 +- apm-network/src/main/proto/KeyWithStringValue.proto | 2 +- apm-network/src/main/proto/TraceSegmentService.proto | 2 +- 8 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 apm-network/src/main/proto/KeyValue.proto diff --git a/apm-network/src/main/proto/ApplicationRegisterService.proto b/apm-network/src/main/proto/ApplicationRegisterService.proto index 9c3285d54..a40392bb3 100644 --- a/apm-network/src/main/proto/ApplicationRegisterService.proto +++ b/apm-network/src/main/proto/ApplicationRegisterService.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.trace.proto"; +option java_package = "org.skywalking.apm.network.proto"; import "KeyWithIntegerValue.proto"; diff --git a/apm-network/src/main/proto/DiscoveryService.proto b/apm-network/src/main/proto/DiscoveryService.proto index 1f22a0df3..420b3d6c9 100644 --- a/apm-network/src/main/proto/DiscoveryService.proto +++ b/apm-network/src/main/proto/DiscoveryService.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.trace.proto"; +option java_package = "org.skywalking.apm.network.proto"; import "Downstream.proto"; diff --git a/apm-network/src/main/proto/Downstream.proto b/apm-network/src/main/proto/Downstream.proto index f5c5ec3c2..cbeb2f41a 100644 --- a/apm-network/src/main/proto/Downstream.proto +++ b/apm-network/src/main/proto/Downstream.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.collecor.proto"; +option java_package = "org.skywalking.apm.network.proto"; // nothing down stream from collector yet. message Downstream { diff --git a/apm-network/src/main/proto/JVMMetricsService.proto b/apm-network/src/main/proto/JVMMetricsService.proto index 22680b686..f7419288e 100644 --- a/apm-network/src/main/proto/JVMMetricsService.proto +++ b/apm-network/src/main/proto/JVMMetricsService.proto @@ -1,5 +1,5 @@ option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.trace.proto"; +option java_package = "org.skywalking.apm.network.proto"; import "Downstream.proto"; diff --git a/apm-network/src/main/proto/KeyValue.proto b/apm-network/src/main/proto/KeyValue.proto deleted file mode 100644 index f03132a38..000000000 --- a/apm-network/src/main/proto/KeyValue.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.collecor.proto"; - -message KeyValue { - string key = 1; - string value = 2; -} diff --git a/apm-network/src/main/proto/KeyWithIntegerValue.proto b/apm-network/src/main/proto/KeyWithIntegerValue.proto index 3a0e4e602..328ef45a5 100644 --- a/apm-network/src/main/proto/KeyWithIntegerValue.proto +++ b/apm-network/src/main/proto/KeyWithIntegerValue.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.collecor.proto"; +option java_package = "org.skywalking.apm.network.proto"; message KeyWithIntegerValue { string key = 1; diff --git a/apm-network/src/main/proto/KeyWithStringValue.proto b/apm-network/src/main/proto/KeyWithStringValue.proto index dabb4d395..e1a3a4e3e 100644 --- a/apm-network/src/main/proto/KeyWithStringValue.proto +++ b/apm-network/src/main/proto/KeyWithStringValue.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.collecor.proto"; +option java_package = "org.skywalking.apm.network.proto"; message KeyWithStringValue { string key = 1; diff --git a/apm-network/src/main/proto/TraceSegmentService.proto b/apm-network/src/main/proto/TraceSegmentService.proto index 6cfa64929..17592a1ad 100644 --- a/apm-network/src/main/proto/TraceSegmentService.proto +++ b/apm-network/src/main/proto/TraceSegmentService.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = true; -option java_package = "org.skywalking.apm.network.trace.proto"; +option java_package = "org.skywalking.apm.network.proto"; import "Downstream.proto"; import "KeyWithStringValue.proto";