Brijesh's Git Server — argus-core @ 48d4f681f4e2301b57e86a5b09ebe156a5115fee

Logging service

rpc/logs/service.proto (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
syntax = "proto3";

package logs;
option go_package = "argus-core/rpc/logs";

service LogsService {
  rpc SendLogs(SendLogsRequest) returns (SendLogsResponse);
  rpc GetLogs(GetLogsRequest) returns (GetLogsResponse);
  rpc GenerateDummyLogs(GenerateDummyLogsRequest) returns (GenerateDummyLogsResponse);
}

// Log level enum
enum LogLevel {
  UNKNOWN = 0;
  DEBUG = 1;
  INFO = 2;
  WARN = 3;
  ERROR = 4;
  FATAL = 5;
}

// Individual log entry
message LogEntry {
  string log_id = 1;
  string timestamp = 2;
  LogLevel level = 3;
  string message = 4;
}

message SendLogsRequest {
  string api_key = 1;  // Application API key for authentication
  repeated LogEntry logs = 2;
}

message SendLogsResponse {
  int32 accepted_count = 1;  // Number of logs successfully stored
}

message GetLogsRequest {
  string token = 1;  // User JWT token for authentication
  string application_id = 2;
  int32 page_size = 3;  // Number of logs per page (default/max: 100)
  string cursor = 4;    // Timestamp of the last log from previous page
  string log_level = 5; // Optional: Filter by log level
  string start_time = 6; // Optional: Start timestamp (RFC3339)
  string end_time = 7;   // Optional: End timestamp (RFC3339)
}

message GetLogsResponse {
  repeated LogEntry logs = 1;
  bool has_more = 2;
  string next_cursor = 3;  // Timestamp to use for the next page
  int32 total_count = 4;   // Total number of logs matching the filter
  string application_name = 5;
}

message GenerateDummyLogsRequest {
  string token = 1;
  string application_id = 2;
}

message GenerateDummyLogsResponse {
  int32 generated_count = 1;
}