micro/debug/service/proto/debug.proto

60 lines
1.2 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
2019-08-06 19:53:14 +03:00
service Debug {
rpc Health(HealthRequest) returns (HealthResponse) {};
rpc Stats(StatsRequest) returns (StatsResponse) {};
rpc Logs(LogRequest) returns (stream Record) {};
2019-08-06 19:53:14 +03:00
}
2019-12-04 15:02:44 +03:00
message HealthRequest {
// optional service name
string service = 1;
}
message HealthResponse {
2016-05-29 00:30:47 +03:00
// default: ok
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 {
// 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 {
2019-12-04 15:02:44 +03:00
// service to request logs for
string service = 1;
// stream records continuously
bool stream = 2;
// count of records to request
2019-12-04 15:02:44 +03:00
int64 count = 3;
// relative time in seconds
// before the current time
// from which to show logs
2019-12-04 15:02:44 +03:00
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;
}