diff --git a/apm-network/src/main/proto/DiscoveryService.proto b/apm-network/src/main/proto/DiscoveryService.proto new file mode 100644 index 000000000..337e32e93 --- /dev/null +++ b/apm-network/src/main/proto/DiscoveryService.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "org.skywalking.apm.network.trace.proto"; + +import "Downstream.proto"; + +//discovery service for application instance, this service is called when application starts +//or http client connection switch to another collector server instance +service InstanceDiscoveryService { + rpc register (ApplicationInstance) returns (ApplicationInstanceMapping) { + } + + rpc registerRecover (ApplicationInstanceMapping) returns (Downstream) { + } +} + +message ApplicationInstance { + string applicationCode = 1; +} + +message ApplicationInstanceMapping { + int32 applicationInstanceId = 1; + int64 registerTime = 2; +} + +//discovery service for ServiceName by Network address or application code +service ServiceNameDiscoveryService { + rpc discovery (ServiceNameCollection) returns (ServiceNameMappingCollection) { + } +} + +message ServiceNameCollection { + repeated ServiceNameElement elements = 1; +} + +message ServiceNameMappingCollection { + repeated ServiceNameMappingElement elements = 1; +} + +message ServiceNameMappingElement { + int32 serviceId = 1; + ServiceNameElement element = 1; +} + +message ServiceNameElement { + ServiceName = 0; + ApplicationCode = 1; +} + diff --git a/apm-network/src/main/proto/RegisterService.proto b/apm-network/src/main/proto/RegisterService.proto index dff94a55d..109de2bd6 100644 --- a/apm-network/src/main/proto/RegisterService.proto +++ b/apm-network/src/main/proto/RegisterService.proto @@ -5,47 +5,16 @@ option java_package = "org.skywalking.apm.network.trace.proto"; //register service for ApplicationCode, this service is called when service starts. service ApplicationRegisterService { - rpc register (ApplicationMetaInfo) returns (ApplicationRegiseredInfo) { + rpc register (Application) returns (ApplicationMapping) { } } -message ApplicationMetaInfo { +message Application { string applicationCode = 1; } -message ApplicationRegiseredInfo { +message ApplicationMapping { int32 applicationId = 1; - int32 applicationInstanceId = 2; -} - -//register service for ServiceName, Network address -service DictionaryRegisterService { - rpc register (DictionaryRegisterMetaInfo) returns (DictionaryRegiseredInfo) { - } -} - -message DictionaryRegisterMetaInfo { - repeated DictionaryRegisterElement elements = 1; -} - -message DictionaryRegisterElement { - RegisterElementType type = 1; - string name = 2; -} - -message DictionaryRegiseredInfo { - repeated DictionaryRegiseredElement elements = 1; -} - -message DictionaryRegiseredElement { - RegisterElementType type = 1; - string name = 2; - int32 id = 3; -} - - -enum RegisterElementType { - ServiceName = 0; - NetworkAddress = 1; + Application = 2; }