gitee.com/sasukebo/go-micro/v4@v4.7.1/debug/proto/debug.proto (about)

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