github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/pkg/ingester/client/ingester.proto (about)

     1  syntax = "proto3";
     2  
     3  package ingesterpb;
     4  
     5  import "github.com/gogo/protobuf/gogoproto/gogo.proto";
     6  import "pkg/logproto/logproto.proto";
     7  import "pkg/logproto/metrics.proto";
     8  
     9  option go_package = "github.com/grafana/loki/pkg/ingester/client";
    10  option (gogoproto.marshaler_all) = true;
    11  option (gogoproto.unmarshaler_all) = true;
    12  
    13  service Ingester {
    14    rpc Push(logproto.WriteRequest) returns (logproto.WriteResponse) {}
    15  
    16    rpc Query(QueryRequest) returns (QueryResponse) {}
    17  
    18    rpc QueryStream(QueryRequest) returns (stream QueryStreamResponse) {}
    19  
    20    rpc QueryExemplars(ExemplarQueryRequest) returns (ExemplarQueryResponse) {}
    21  
    22    rpc LabelValues(LabelValuesRequest) returns (LabelValuesResponse) {}
    23  
    24    rpc LabelNames(LabelNamesRequest) returns (LabelNamesResponse) {}
    25  
    26    rpc UserStats(UserStatsRequest) returns (UserStatsResponse) {}
    27  
    28    rpc AllUserStats(UserStatsRequest) returns (UsersStatsResponse) {}
    29  
    30    rpc MetricsForLabelMatchers(MetricsForLabelMatchersRequest) returns (MetricsForLabelMatchersResponse) {}
    31  
    32    rpc MetricsMetadata(MetricsMetadataRequest) returns (MetricsMetadataResponse) {}
    33  
    34    // TransferChunks allows leaving ingester (client) to stream chunks directly to joining ingesters (server).
    35    rpc TransferChunks(stream TimeSeriesChunk) returns (TransferChunksResponse) {}
    36  }
    37  
    38  message ReadRequest {
    39    repeated QueryRequest queries = 1;
    40  }
    41  
    42  message ReadResponse {
    43    repeated QueryResponse results = 1;
    44  }
    45  
    46  message QueryRequest {
    47    int64 start_timestamp_ms = 1;
    48    int64 end_timestamp_ms = 2;
    49    repeated LabelMatcher matchers = 3;
    50  }
    51  
    52  message ExemplarQueryRequest {
    53    int64 start_timestamp_ms = 1;
    54    int64 end_timestamp_ms = 2;
    55    repeated LabelMatchers matchers = 3;
    56  }
    57  
    58  message QueryResponse {
    59    repeated logproto.TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
    60  }
    61  
    62  // QueryStreamResponse contains a batch of timeseries chunks or timeseries. Only one of these series will be populated.
    63  message QueryStreamResponse {
    64    repeated TimeSeriesChunk chunkseries = 1 [(gogoproto.nullable) = false];
    65    repeated logproto.TimeSeries timeseries = 2 [(gogoproto.nullable) = false];
    66  }
    67  
    68  message ExemplarQueryResponse {
    69    repeated logproto.TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
    70  }
    71  
    72  message LabelValuesRequest {
    73    string label_name = 1;
    74    int64 start_timestamp_ms = 2;
    75    int64 end_timestamp_ms = 3;
    76    LabelMatchers matchers = 4;
    77  }
    78  
    79  message LabelValuesResponse {
    80    repeated string label_values = 1;
    81  }
    82  
    83  message LabelNamesRequest {
    84    int64 start_timestamp_ms = 1;
    85    int64 end_timestamp_ms = 2;
    86  }
    87  
    88  message LabelNamesResponse {
    89    repeated string label_names = 1;
    90  }
    91  
    92  message UserStatsRequest {}
    93  
    94  message UserStatsResponse {
    95    double ingestion_rate = 1;
    96    uint64 num_series = 2;
    97    double api_ingestion_rate = 3;
    98    double rule_ingestion_rate = 4;
    99  }
   100  
   101  message UserIDStatsResponse {
   102    string user_id = 1;
   103    UserStatsResponse data = 2;
   104  }
   105  
   106  message UsersStatsResponse {
   107    repeated UserIDStatsResponse stats = 1;
   108  }
   109  
   110  message MetricsForLabelMatchersRequest {
   111    int64 start_timestamp_ms = 1;
   112    int64 end_timestamp_ms = 2;
   113    repeated LabelMatchers matchers_set = 3;
   114  }
   115  
   116  message MetricsForLabelMatchersResponse {
   117    repeated logproto.Metric metric = 1;
   118  }
   119  
   120  message MetricsMetadataRequest {}
   121  
   122  message MetricsMetadataResponse {
   123    repeated logproto.MetricMetadata metadata = 1;
   124  }
   125  
   126  message TimeSeriesChunk {
   127    string from_ingester_id = 1;
   128    string user_id = 2;
   129    repeated logproto.LegacyLabelPair labels = 3 [
   130      (gogoproto.nullable) = false,
   131      (gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter"
   132    ];
   133    repeated Chunk chunks = 4 [(gogoproto.nullable) = false];
   134  }
   135  
   136  message Chunk {
   137    int64 start_timestamp_ms = 1;
   138    int64 end_timestamp_ms = 2;
   139    int32 encoding = 3;
   140    bytes data = 4;
   141  }
   142  
   143  message TransferChunksResponse {}
   144  
   145  message LabelMatchers {
   146    repeated LabelMatcher matchers = 1;
   147  }
   148  
   149  enum MatchType {
   150    EQUAL = 0;
   151    NOT_EQUAL = 1;
   152    REGEX_MATCH = 2;
   153    REGEX_NO_MATCH = 3;
   154  }
   155  
   156  message LabelMatcher {
   157    MatchType type = 1;
   158    string name = 2;
   159    string value = 3;
   160  }
   161  
   162  message TimeSeriesFile {
   163    string from_ingester_id = 1;
   164    string user_id = 2;
   165    string filename = 3;
   166    bytes data = 4;
   167  }