2016-01-06 22:24:54 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2019-08-06 19:53:14 +03:00
|
|
|
service Debug {
|
2020-05-24 20:45:57 +03:00
|
|
|
rpc Log(LogRequest) returns (stream Record) {};
|
|
|
|
rpc Health(HealthRequest) returns (HealthResponse) {};
|
|
|
|
rpc Stats(StatsRequest) returns (StatsResponse) {};
|
2020-01-25 00:29:29 +03:00
|
|
|
rpc Trace(TraceRequest) returns (TraceResponse) {};
|
2020-05-24 20:45:57 +03:00
|
|
|
rpc Cache(CacheRequest) returns (CacheResponse) {};
|
2019-08-06 19:53:14 +03:00
|
|
|
}
|
2016-01-06 22:24:54 +03:00
|
|
|
|
2019-12-04 15:02:44 +03:00
|
|
|
message HealthRequest {
|
|
|
|
// optional service name
|
|
|
|
string service = 1;
|
|
|
|
}
|
2016-01-06 22:24:54 +03:00
|
|
|
|
|
|
|
message HealthResponse {
|
2016-05-29 00:30:47 +03:00
|
|
|
// default: ok
|
2016-01-06 22:24:54 +03:00
|
|
|
string status = 1;
|
|
|
|
}
|
2016-05-29 00:30:47 +03:00
|
|
|
|
2019-12-04 15:02:44 +03:00
|
|
|
message StatsRequest {
|
|
|
|
// optional service name
|
|
|
|
string service = 1;
|
|
|
|
}
|
2016-05-29 00:30:47 +03:00
|
|
|
|
|
|
|
message StatsResponse {
|
2019-12-05 02:51:07 +03:00
|
|
|
// timestamp of recording
|
|
|
|
uint64 timestamp = 1;
|
2016-05-29 00:30:47 +03:00
|
|
|
// unix timestamp
|
2019-12-05 02:51:07 +03:00
|
|
|
uint64 started = 2;
|
2016-05-29 00:30:47 +03:00
|
|
|
// in seconds
|
2019-12-05 02:51:07 +03:00
|
|
|
uint64 uptime = 3;
|
2016-05-29 00:30:47 +03:00
|
|
|
// in bytes
|
2019-12-05 02:51:07 +03:00
|
|
|
uint64 memory = 4;
|
2016-05-29 00:30:47 +03:00
|
|
|
// num threads
|
2019-12-05 02:51:07 +03:00
|
|
|
uint64 threads = 5;
|
2016-05-29 00:30:47 +03:00
|
|
|
// total gc in nanoseconds
|
2019-12-05 02:51:07 +03:00
|
|
|
uint64 gc = 6;
|
2019-12-18 21:36:42 +03:00
|
|
|
// total number of requests
|
|
|
|
uint64 requests = 7;
|
|
|
|
// total number of errors
|
|
|
|
uint64 errors = 8;
|
2016-05-29 00:30:47 +03:00
|
|
|
}
|
2019-11-26 18:39:55 +03:00
|
|
|
|
2019-12-01 16:15:10 +03:00
|
|
|
// LogRequest requests service logs
|
2019-11-26 18:39:55 +03:00
|
|
|
message LogRequest {
|
2019-12-04 15:02:44 +03:00
|
|
|
// service to request logs for
|
|
|
|
string service = 1;
|
2019-12-04 15:28:16 +03:00
|
|
|
// stream records continuously
|
|
|
|
bool stream = 2;
|
|
|
|
// count of records to request
|
|
|
|
int64 count = 3;
|
|
|
|
// relative time in seconds
|
|
|
|
// before the current time
|
|
|
|
// from which to show logs
|
|
|
|
int64 since = 4;
|
2019-11-26 18:39:55 +03:00
|
|
|
}
|
|
|
|
|
2019-12-01 16:15:10 +03:00
|
|
|
// Record is service log record
|
|
|
|
message Record {
|
2020-02-12 13:57:17 +03:00
|
|
|
// timestamp of log record
|
|
|
|
int64 timestamp = 1;
|
|
|
|
// record metadata
|
|
|
|
map<string,string> metadata = 2;
|
|
|
|
// message
|
|
|
|
string message = 3;
|
2019-11-26 18:39:55 +03:00
|
|
|
}
|
2020-01-25 00:29:29 +03:00
|
|
|
|
|
|
|
message TraceRequest {
|
|
|
|
// trace id to retrieve
|
|
|
|
string id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TraceResponse {
|
|
|
|
repeated Span spans = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-02-12 13:57:17 +03:00
|
|
|
enum SpanType {
|
|
|
|
INBOUND = 0;
|
|
|
|
OUTBOUND = 1;
|
|
|
|
}
|
|
|
|
|
2020-01-25 00:29:29 +03:00
|
|
|
message Span {
|
|
|
|
// the trace id
|
|
|
|
string trace = 1;
|
|
|
|
// id of the span
|
|
|
|
string id = 2;
|
|
|
|
// parent span
|
|
|
|
string parent = 3;
|
|
|
|
// name of the resource
|
|
|
|
string name = 4;
|
|
|
|
// time of start in nanoseconds
|
|
|
|
uint64 started = 5;
|
|
|
|
// duration of the execution in nanoseconds
|
|
|
|
uint64 duration = 6;
|
|
|
|
// associated metadata
|
|
|
|
map<string,string> metadata = 7;
|
2020-02-12 13:57:17 +03:00
|
|
|
SpanType type = 8;
|
2020-01-25 00:29:29 +03:00
|
|
|
}
|
2020-05-24 20:45:57 +03:00
|
|
|
|
|
|
|
message CacheRequest {}
|
|
|
|
|
|
|
|
message CacheResponse {
|
|
|
|
map<string, string> values = 1;
|
|
|
|
}
|