2016-01-06 22:24:54 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2019-08-06 19:53:14 +03:00
|
|
|
service Debug {
|
2019-12-01 16:15:10 +03:00
|
|
|
rpc Health(HealthRequest) returns (HealthResponse) {};
|
|
|
|
rpc Stats(StatsRequest) returns (StatsResponse) {};
|
|
|
|
rpc Logs(LogRequest) returns (stream Record) {};
|
2019-08-06 19:53:14 +03:00
|
|
|
}
|
2016-01-06 22:24:54 +03:00
|
|
|
|
2019-11-26 18:39:55 +03:00
|
|
|
message HealthRequest {}
|
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-11-26 18:39:55 +03:00
|
|
|
message StatsRequest {}
|
2016-05-29 00:30:47 +03:00
|
|
|
|
|
|
|
message StatsResponse {
|
|
|
|
// unix timestamp
|
|
|
|
uint64 started = 1;
|
|
|
|
// in seconds
|
|
|
|
uint64 uptime = 2;
|
|
|
|
// in bytes
|
|
|
|
uint64 memory = 3;
|
|
|
|
// num threads
|
|
|
|
uint64 threads = 4;
|
|
|
|
// total gc in nanoseconds
|
|
|
|
uint64 gc = 5;
|
|
|
|
}
|
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-01 16:15:10 +03:00
|
|
|
// count of records to request
|
2019-11-27 21:38:26 +03:00
|
|
|
int64 count = 1;
|
2019-11-26 18:39:55 +03:00
|
|
|
// relative time in seconds
|
|
|
|
// before the current time
|
|
|
|
// from which to show logs
|
2019-11-27 21:38:26 +03:00
|
|
|
int64 since = 2;
|
2019-12-01 16:15:10 +03:00
|
|
|
// stream records continuously
|
2019-11-26 18:39:55 +03:00
|
|
|
bool stream = 3;
|
|
|
|
}
|
|
|
|
|
2019-12-01 16:15:10 +03:00
|
|
|
// Record is service log record
|
|
|
|
message Record {
|
|
|
|
// timestamp of log record
|
2019-11-27 20:31:35 +03:00
|
|
|
int64 timestamp = 1;
|
2019-12-01 16:15:10 +03:00
|
|
|
// record value
|
2019-11-27 20:31:35 +03:00
|
|
|
string value = 2;
|
2019-12-01 16:15:10 +03:00
|
|
|
// record metadata
|
2019-11-27 20:31:35 +03:00
|
|
|
map<string,string> metadata = 3;
|
2019-11-26 18:39:55 +03:00
|
|
|
}
|