github.com/thanos-io/thanos@v0.32.5/pkg/api/query/querypb/query.proto (about) 1 // Copyright (c) The Thanos Authors. 2 // Licensed under the Apache License 2.0. 3 4 syntax = "proto3"; 5 package thanos; 6 7 option go_package = "querypb"; 8 9 import "gogoproto/gogo.proto"; 10 import "store/storepb/types.proto"; 11 import "store/storepb/rpc.proto"; 12 import "store/storepb/prompb/types.proto"; 13 14 option (gogoproto.sizer_all) = true; 15 option (gogoproto.marshaler_all) = true; 16 option (gogoproto.unmarshaler_all) = true; 17 option (gogoproto.goproto_getters_all) = false; 18 19 // Do not generate XXX fields to reduce memory footprint and opening a door 20 // for zero-copy casts to/from prometheus data types. 21 option (gogoproto.goproto_unkeyed_all) = false; 22 option (gogoproto.goproto_unrecognized_all) = false; 23 option (gogoproto.goproto_sizecache_all) = false; 24 25 enum EngineType { 26 default = 0; 27 prometheus = 1; 28 thanos = 2; 29 } 30 31 message QueryRequest { 32 string query = 1; 33 34 int64 time_seconds = 2; 35 int64 timeout_seconds = 3; 36 int64 max_resolution_seconds = 4; 37 38 repeated string replica_labels = 5; 39 40 repeated StoreMatchers storeMatchers = 6 [(gogoproto.nullable) = false]; 41 42 bool enableDedup = 7; 43 bool enablePartialResponse = 8; 44 bool enableQueryPushdown = 9; 45 bool skipChunks = 10; 46 47 ShardInfo shard_info = 11; 48 49 int64 lookback_delta_seconds = 12; 50 EngineType engine = 13; 51 } 52 53 message StoreMatchers { 54 repeated LabelMatcher labelMatchers = 1 [(gogoproto.nullable) = false]; 55 } 56 57 message QueryResponse { 58 oneof result { 59 /// warnings are additional messages coming from the PromQL engine. 60 string warnings = 1; 61 62 /// timeseries is one series from the result of the executed query. 63 prometheus_copy.TimeSeries timeseries = 2; 64 } 65 } 66 67 message QueryRangeRequest { 68 string query = 1; 69 70 int64 start_time_seconds = 2; 71 int64 end_time_seconds = 3; 72 int64 interval_seconds = 4; 73 74 int64 timeout_seconds = 5; 75 int64 max_resolution_seconds = 6; 76 77 repeated string replica_labels = 7; 78 79 repeated StoreMatchers storeMatchers = 8 [(gogoproto.nullable) = false]; 80 81 bool enableDedup = 9; 82 bool enablePartialResponse = 10; 83 bool enableQueryPushdown = 11; 84 bool skipChunks = 12; 85 86 ShardInfo shard_info = 13; 87 int64 lookback_delta_seconds = 14; 88 EngineType engine = 15; 89 } 90 91 message QueryRangeResponse { 92 oneof result { 93 /// warnings are additional messages coming from the PromQL engine. 94 string warnings = 1; 95 96 /// timeseries is one series from the result of the executed query. 97 prometheus_copy.TimeSeries timeseries = 2; 98 } 99 } 100 101 service Query { 102 rpc Query(QueryRequest) returns (stream QueryResponse); 103 104 rpc QueryRange(QueryRangeRequest) returns (stream QueryRangeResponse); 105 }