github.com/m3db/m3@v1.5.0/src/query/generated/proto/rpcpb/query.proto (about) 1 syntax = "proto3"; 2 3 package rpc; 4 5 option go_package = "rpcpb"; 6 7 import "github.com/m3db/m3/src/metrics/generated/proto/policypb/policy.proto"; 8 9 service Query { 10 rpc Health(HealthRequest) returns (HealthResponse); 11 rpc Fetch(FetchRequest) returns (stream FetchResponse); 12 rpc Search(SearchRequest) returns (stream SearchResponse); 13 rpc CompleteTags(CompleteTagsRequest) returns (stream CompleteTagsResponse); 14 } 15 16 message HealthRequest { 17 } 18 19 message HealthResponse { 20 string uptimeDuration = 1; 21 int64 uptimeNanoseconds = 2; 22 } 23 24 message FetchRequest { 25 int64 start = 1; 26 int64 end = 2; 27 oneof matchers { 28 TagMatchers tagMatchers = 3; 29 } 30 FetchOptions options = 4; 31 } 32 33 message TagMatchers { 34 repeated TagMatcher tagMatchers = 1; 35 } 36 37 message TagMatcher { 38 bytes name = 1; 39 bytes value = 2; 40 MatcherType type = 3; 41 } 42 43 enum MatcherType { 44 EQUAL = 0; 45 NOTEQUAL = 1; 46 REGEXP = 2; 47 NOTREGEXP = 3; 48 // EXISTS and NOTEXISTS apply only to 49 // matcher name rather than value. 50 EXISTS = 4; 51 NOTEXISTS = 5; 52 // ALL supercedes other matcher types 53 // and does no filtering. 54 ALL = 6; 55 } 56 57 message FetchOptions { 58 int64 limit = 1; 59 RestrictQueryOptions restrict = 2; 60 int64 lookbackDuration = 3; 61 FanoutOption unaggregated = 4; 62 FanoutOption aggregated = 5; 63 FanoutOption aggregatedOptimized = 6; 64 // Deprecated: all requests will include resolution. 65 bool includeResolution = 7 [deprecated=true]; 66 bytes source = 8; 67 } 68 69 message RestrictQueryOptions { 70 RestrictQueryType restrictQueryType = 3; 71 RestrictQueryTags restrictQueryTags = 4; 72 } 73 74 message RestrictQueryType { 75 MetricsType metricsType = 1; 76 policypb.StoragePolicy metricsStoragePolicy = 2; 77 } 78 79 message RestrictQueryTags { 80 TagMatchers restrict = 1; 81 repeated bytes strip = 2; 82 } 83 84 enum MetricsType { 85 UNKNOWN_METRICS_TYPE = 0; 86 UNAGGREGATED_METRICS_TYPE = 1; 87 AGGREGATED_METRICS_TYPE = 2; 88 } 89 90 enum FanoutOption { 91 DEFAULT_OPTION = 0; 92 FORCE_ENABLED = 1; 93 FORCE_DISABLED = 2; 94 } 95 96 message FetchResponse { 97 repeated Series series = 1; 98 ResultMetadata meta = 2; 99 } 100 101 message Series { 102 SeriesMetadata meta = 1; 103 oneof value { 104 DecompressedSeries decompressed = 2; 105 M3CompressedSeries compressed = 3; 106 } 107 } 108 109 message SeriesMetadata { 110 bytes id = 1; 111 int64 startTime = 2; 112 int64 endTime = 3; 113 } 114 115 message DecompressedSeries { 116 repeated Datapoint datapoints = 1; 117 repeated Tag tags = 2; 118 } 119 120 message Datapoint { 121 int64 timestamp = 1; 122 double value = 2; 123 } 124 125 message Tag { 126 bytes name = 1; 127 bytes value = 2; 128 } 129 130 message M3CompressedSeries { 131 bytes compressedTags = 1; 132 repeated M3CompressedValuesReplica replicas = 2; 133 } 134 135 message M3CompressedValuesReplica { 136 repeated M3Segments segments = 1; 137 } 138 139 message M3Segments { 140 M3Segment merged = 1; 141 repeated M3Segment unmerged = 2; 142 } 143 144 message M3Segment { 145 bytes head = 1; 146 bytes tail = 2; 147 int64 startTime = 3; 148 int64 blockSize = 4; 149 uint32 checksum = 5; 150 } 151 152 message SearchRequest { 153 oneof matchers { 154 TagMatchers tagMatchers = 1; 155 } 156 int64 start = 2; 157 int64 end = 3; 158 FetchOptions options = 4; 159 } 160 161 message M3TagProperty { 162 bytes id = 1; 163 bytes compressedTags = 2; 164 } 165 166 message M3TagProperties { 167 repeated M3TagProperty properties = 1; 168 } 169 170 message TagProperty { 171 bytes key = 1; 172 bytes values = 2; 173 } 174 175 message TagProperties { 176 repeated TagProperty properties = 1; 177 } 178 179 message SearchResponse { 180 oneof value { 181 TagProperties decompressed = 1; 182 M3TagProperties compressed = 2; 183 } 184 185 ResultMetadata meta = 3; 186 } 187 188 enum CompleteTagsType { 189 // Requests tag names and values 190 DEFAULT = 0; 191 // Requests tag names only 192 TAGNAME = 1; 193 } 194 195 message CompleteTagsRequestOptions { 196 CompleteTagsType type = 1; 197 repeated bytes filterNameTags = 2; 198 int64 start = 3; 199 int64 end = 4; 200 FetchOptions options = 5; 201 } 202 203 message CompleteTagsRequest { 204 oneof matchers { 205 TagMatchers tagMatchers = 1; 206 } 207 208 CompleteTagsRequestOptions options = 2; 209 } 210 211 message TagNames { 212 repeated bytes names = 1; 213 } 214 215 message TagValue { 216 bytes key = 1; 217 repeated bytes values = 2; 218 } 219 220 message TagValues { 221 repeated TagValue values = 1; 222 } 223 224 message CompleteTagsResponse { 225 oneof value { 226 TagValues default = 1; 227 TagNames namesOnly = 2; 228 } 229 230 ResultMetadata meta = 3; 231 } 232 233 message ResultMetadata { 234 bool exhaustive = 1; 235 repeated Warning warnings = 2; 236 repeated int64 resolutions = 3; 237 } 238 239 message Warning { 240 bytes name = 1; 241 bytes message = 2; 242 }