github.com/annwntech/go-micro/v2@v2.9.5/debug/service/proto/debug.proto (about) 1 syntax = "proto3"; 2 3 service Debug { 4 rpc Log(LogRequest) returns (stream Record) {}; 5 rpc Health(HealthRequest) returns (HealthResponse) {}; 6 rpc Stats(StatsRequest) returns (StatsResponse) {}; 7 rpc Trace(TraceRequest) returns (TraceResponse) {}; 8 rpc Cache(CacheRequest) returns (CacheResponse) {}; 9 } 10 11 message HealthRequest { 12 // optional service name 13 string service = 1; 14 } 15 16 message HealthResponse { 17 // default: ok 18 string status = 1; 19 } 20 21 message StatsRequest { 22 // optional service name 23 string service = 1; 24 } 25 26 message StatsResponse { 27 // timestamp of recording 28 uint64 timestamp = 1; 29 // unix timestamp 30 uint64 started = 2; 31 // in seconds 32 uint64 uptime = 3; 33 // in bytes 34 uint64 memory = 4; 35 // num threads 36 uint64 threads = 5; 37 // total gc in nanoseconds 38 uint64 gc = 6; 39 // total number of requests 40 uint64 requests = 7; 41 // total number of errors 42 uint64 errors = 8; 43 } 44 45 // LogRequest requests service logs 46 message LogRequest { 47 // service to request logs for 48 string service = 1; 49 // stream records continuously 50 bool stream = 2; 51 // count of records to request 52 int64 count = 3; 53 // relative time in seconds 54 // before the current time 55 // from which to show logs 56 int64 since = 4; 57 } 58 59 // Record is service log record 60 message Record { 61 // timestamp of log record 62 int64 timestamp = 1; 63 // record metadata 64 map<string,string> metadata = 2; 65 // message 66 string message = 3; 67 } 68 69 message TraceRequest { 70 // trace id to retrieve 71 string id = 1; 72 } 73 74 message TraceResponse { 75 repeated Span spans = 1; 76 } 77 78 79 enum SpanType { 80 INBOUND = 0; 81 OUTBOUND = 1; 82 } 83 84 message Span { 85 // the trace id 86 string trace = 1; 87 // id of the span 88 string id = 2; 89 // parent span 90 string parent = 3; 91 // name of the resource 92 string name = 4; 93 // time of start in nanoseconds 94 uint64 started = 5; 95 // duration of the execution in nanoseconds 96 uint64 duration = 6; 97 // associated metadata 98 map<string,string> metadata = 7; 99 SpanType type = 8; 100 } 101 102 message CacheRequest {} 103 104 message CacheResponse { 105 map<string, string> values = 1; 106 }