github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/ingester/client/ingester.proto (about)

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