micro/debug/service/proto/debug.proto

62 lines
1.2 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
2019-08-06 17:53:14 +01:00
service Debug {
rpc Health(HealthRequest) returns (HealthResponse) {};
rpc Stats(StatsRequest) returns (StatsResponse) {};
2019-12-04 23:58:29 +00:00
rpc Log(LogRequest) returns (stream Record) {};
2019-08-06 17:53:14 +01:00
}
2019-12-04 12:02:44 +00:00
message HealthRequest {
// optional service name
string service = 1;
}
message HealthResponse {
2016-05-28 22:30:47 +01:00
// default: ok
string status = 1;
}
2016-05-28 22:30:47 +01:00
2019-12-04 12:02:44 +00:00
message StatsRequest {
// optional service name
string service = 1;
}
2016-05-28 22:30:47 +01:00
message StatsResponse {
2019-12-04 23:51:07 +00:00
// timestamp of recording
uint64 timestamp = 1;
2016-05-28 22:30:47 +01:00
// unix timestamp
2019-12-04 23:51:07 +00:00
uint64 started = 2;
2016-05-28 22:30:47 +01:00
// in seconds
2019-12-04 23:51:07 +00:00
uint64 uptime = 3;
2016-05-28 22:30:47 +01:00
// in bytes
2019-12-04 23:51:07 +00:00
uint64 memory = 4;
2016-05-28 22:30:47 +01:00
// num threads
2019-12-04 23:51:07 +00:00
uint64 threads = 5;
2016-05-28 22:30:47 +01:00
// total gc in nanoseconds
2019-12-04 23:51:07 +00:00
uint64 gc = 6;
2016-05-28 22:30:47 +01:00
}
// LogRequest requests service logs
message LogRequest {
2019-12-04 12:02:44 +00:00
// service to request logs for
string service = 1;
2019-12-04 12:28:16 +00: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;
}
// Record is service log record
message Record {
// timestamp of log record
int64 timestamp = 1;
// record value
string value = 2;
// record metadata
map<string,string> metadata = 3;
}