DiscoveryService.proto 1.6 KB
Newer Older
1 2 3
syntax = "proto3";

option java_multiple_files = true;
4
option java_package = "org.skywalking.apm.network.proto";
5 6 7 8 9 10 11 12 13

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) {
    }

14 15 16
    rpc heartbeat (ApplicationInstanceHeartbeat) returns (Downstream) {
    }

17
    rpc registerRecover (ApplicationInstanceRecover) returns (Downstream) {
18 19 20 21
    }
}

message ApplicationInstance {
P
pengys5 已提交
22
    int32 applicationId = 1;
23
    int64 registerTime = 2;
24 25 26
}

message ApplicationInstanceMapping {
wu-sheng's avatar
wu-sheng 已提交
27 28
    int32 applicationId = 1;
    int32 applicationInstanceId = 2;
29 30 31 32 33
}

message ApplicationInstanceRecover {
    int32 applicationId = 1;
    int32 applicationInstanceId = 2;
34
    int64 registerTime = 3;
35 36 37 38 39
}

message ApplicationInstanceHeartbeat {
    int32 applicationInstanceId = 1;
    int64 heartbeatTime = 2;
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
}

//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;
P
pengys5 已提交
58
    ServiceNameElement element = 2;
59 60 61
}

message ServiceNameElement {
P
pengys5 已提交
62
    string serviceName = 1;
P
pengys5 已提交
63
    int32 applicationId = 2;
64
}