DiscoveryService.proto 1.8 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;
wu-sheng's avatar
wu-sheng 已提交
23 24
    string agentUUID = 2;
    int64 registerTime = 3;
25
    OSInfo osinfo = 4;
26 27 28
}

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

message ApplicationInstanceRecover {
    int32 applicationId = 1;
    int32 applicationInstanceId = 2;
36
    int64 registerTime = 3;
37
    OSInfo osinfo = 4;
38 39 40 41 42
}

message ApplicationInstanceHeartbeat {
    int32 applicationInstanceId = 1;
    int64 heartbeatTime = 2;
43 44
}

45 46 47
message OSInfo {
    string osName = 1;
    string hostname = 2;
wu-sheng's avatar
wu-sheng 已提交
48 49
    int32 processNo = 3;
    repeated string ipv4s = 4;
50 51
}

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
//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 已提交
68
    ServiceNameElement element = 2;
69 70 71
}

message ServiceNameElement {
P
pengys5 已提交
72
    string serviceName = 1;
P
pengys5 已提交
73
    int32 applicationId = 2;
wu-sheng's avatar
wu-sheng 已提交
74
}