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