github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/debug/debug.proto (about)

     1  syntax = "proto3";
     2  
     3  package debug;
     4  
     5  option go_package = "github.com/tickoalcantara12/micro/v3/debug/proto;debug";
     6  
     7  service Debug {
     8  	rpc Log(LogRequest) returns (LogResponse) {};
     9  	rpc Health(HealthRequest) returns (HealthResponse) {};
    10  	rpc Stats(StatsRequest) returns (StatsResponse) {};
    11  	rpc Trace(TraceRequest) returns (TraceResponse) {};
    12  }
    13  
    14  message HealthRequest {}
    15  
    16  message HealthResponse {
    17  	// default: ok
    18  	string status = 1;
    19  }
    20  
    21  message StatsRequest {}
    22  
    23  message StatsResponse {
    24  	// timestamp of recording
    25  	uint64 timestamp = 1;
    26  	// unix timestamp
    27  	uint64 started = 2;
    28  	// in seconds
    29  	uint64 uptime = 3;
    30  	// in bytes
    31  	uint64 memory = 4;
    32  	// num threads
    33  	uint64 threads = 5;
    34  	// total gc in nanoseconds
    35  	uint64 gc = 6;
    36  	// total number of requests
    37  	uint64 requests = 7;
    38  	// total number of errors
    39  	uint64 errors = 8;
    40  }
    41  
    42  // LogRequest requests service logs
    43  message LogRequest {
    44  	// count of records to request
    45  	int64 count = 1;
    46  	// relative time in seconds
    47  	// before the current time
    48  	// from which to show logs
    49  	int64 since = 2;
    50  }
    51  
    52  // LogResponse returns a list of logs
    53  message LogResponse {
    54  	repeated Record records = 1;
    55  }
    56  
    57  // Record is service log record
    58  message Record {
    59      // timestamp of log record
    60      int64 timestamp = 1;
    61      // record metadata
    62      map<string,string> metadata = 2;
    63      // message
    64      string message = 3;
    65  }
    66  
    67  message TraceRequest {
    68  	// trace id to retrieve
    69  	string id = 1;
    70  }
    71  
    72  message TraceResponse {
    73  	repeated Span spans = 1;
    74  }
    75  
    76  
    77  enum SpanType {
    78      INBOUND = 0;
    79      OUTBOUND = 1;
    80  }
    81  
    82  message Span {
    83  	// the trace id
    84  	string trace = 1;
    85  	// id of the span
    86  	string id = 2;
    87  	// parent span
    88  	string parent = 3;
    89  	// name of the resource
    90  	string name = 4;
    91  	// time of start in nanoseconds
    92  	uint64 started = 5;
    93  	// duration of the execution in nanoseconds
    94  	uint64 duration = 6;
    95  	// associated metadata
    96  	map<string,string> metadata = 7;
    97  	SpanType type = 8;
    98  }
    99