4613a820ca
* log.Write now accepts log.Record * we stream last 10 records first * regenerate proto because of the above
52 lines
1.1 KiB
Protocol Buffer
52 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
service Debug {
|
|
rpc Health(HealthRequest) returns (HealthResponse) {};
|
|
rpc Stats(StatsRequest) returns (StatsResponse) {};
|
|
rpc Logs(LogRequest) returns (stream Record) {};
|
|
}
|
|
|
|
message HealthRequest {}
|
|
|
|
message HealthResponse {
|
|
// default: ok
|
|
string status = 1;
|
|
}
|
|
|
|
message StatsRequest {}
|
|
|
|
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;
|
|
}
|
|
|
|
// LogRequest requests service logs
|
|
message LogRequest {
|
|
// count of records to request
|
|
int64 count = 1;
|
|
// relative time in seconds
|
|
// before the current time
|
|
// from which to show logs
|
|
int64 since = 2;
|
|
// stream records continuously
|
|
bool stream = 3;
|
|
}
|
|
|
|
// 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;
|
|
}
|