1#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct MetricMetadata {
6 #[prost(enumeration = "metric_metadata::MetricType", tag = "1")]
9 pub r#type: i32,
10 #[prost(string, tag = "2")]
11 pub metric_family_name: ::prost::alloc::string::String,
12 #[prost(string, tag = "4")]
13 pub help: ::prost::alloc::string::String,
14 #[prost(string, tag = "5")]
15 pub unit: ::prost::alloc::string::String,
16}
17pub mod metric_metadata {
19 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
20 #[repr(i32)]
21 pub enum MetricType {
22 Unknown = 0,
23 Counter = 1,
24 Gauge = 2,
25 Histogram = 3,
26 Gaugehistogram = 4,
27 Summary = 5,
28 Info = 6,
29 Stateset = 7,
30 }
31 impl MetricType {
32 pub fn as_str_name(&self) -> &'static str {
37 match self {
38 MetricType::Unknown => "UNKNOWN",
39 MetricType::Counter => "COUNTER",
40 MetricType::Gauge => "GAUGE",
41 MetricType::Histogram => "HISTOGRAM",
42 MetricType::Gaugehistogram => "GAUGEHISTOGRAM",
43 MetricType::Summary => "SUMMARY",
44 MetricType::Info => "INFO",
45 MetricType::Stateset => "STATESET",
46 }
47 }
48 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
50 match value {
51 "UNKNOWN" => Some(Self::Unknown),
52 "COUNTER" => Some(Self::Counter),
53 "GAUGE" => Some(Self::Gauge),
54 "HISTOGRAM" => Some(Self::Histogram),
55 "GAUGEHISTOGRAM" => Some(Self::Gaugehistogram),
56 "SUMMARY" => Some(Self::Summary),
57 "INFO" => Some(Self::Info),
58 "STATESET" => Some(Self::Stateset),
59 _ => None,
60 }
61 }
62 }
63}
64#[allow(clippy::derive_partial_eq_without_eq)]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct Sample {
67 #[prost(double, tag = "1")]
68 pub value: f64,
69 #[prost(int64, tag = "2")]
72 pub timestamp: i64,
73}
74#[allow(clippy::derive_partial_eq_without_eq)]
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct Exemplar {
77 #[prost(message, repeated, tag = "1")]
79 pub labels: ::prost::alloc::vec::Vec<Label>,
80 #[prost(double, tag = "2")]
81 pub value: f64,
82 #[prost(int64, tag = "3")]
85 pub timestamp: i64,
86}
87#[allow(clippy::derive_partial_eq_without_eq)]
94#[derive(Clone, PartialEq, ::prost::Message)]
95pub struct Histogram {
96 #[prost(double, tag = "3")]
98 pub sum: f64,
99 #[prost(sint32, tag = "4")]
107 pub schema: i32,
108 #[prost(double, tag = "5")]
110 pub zero_threshold: f64,
111 #[prost(message, repeated, tag = "8")]
113 pub negative_spans: ::prost::alloc::vec::Vec<BucketSpan>,
114 #[prost(sint64, repeated, tag = "9")]
120 pub negative_deltas: ::prost::alloc::vec::Vec<i64>,
121 #[prost(double, repeated, tag = "10")]
123 pub negative_counts: ::prost::alloc::vec::Vec<f64>,
124 #[prost(message, repeated, tag = "11")]
126 pub positive_spans: ::prost::alloc::vec::Vec<BucketSpan>,
127 #[prost(sint64, repeated, tag = "12")]
133 pub positive_deltas: ::prost::alloc::vec::Vec<i64>,
134 #[prost(double, repeated, tag = "13")]
136 pub positive_counts: ::prost::alloc::vec::Vec<f64>,
137 #[prost(enumeration = "histogram::ResetHint", tag = "14")]
138 pub reset_hint: i32,
139 #[prost(int64, tag = "15")]
142 pub timestamp: i64,
143 #[prost(oneof = "histogram::Count", tags = "1, 2")]
145 pub count: ::core::option::Option<histogram::Count>,
146 #[prost(oneof = "histogram::ZeroCount", tags = "6, 7")]
148 pub zero_count: ::core::option::Option<histogram::ZeroCount>,
149}
150pub mod histogram {
152 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
153 #[repr(i32)]
154 pub enum ResetHint {
155 Unknown = 0,
157 Yes = 1,
159 No = 2,
161 Gauge = 3,
163 }
164 impl ResetHint {
165 pub fn as_str_name(&self) -> &'static str {
170 match self {
171 ResetHint::Unknown => "UNKNOWN",
172 ResetHint::Yes => "YES",
173 ResetHint::No => "NO",
174 ResetHint::Gauge => "GAUGE",
175 }
176 }
177 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
179 match value {
180 "UNKNOWN" => Some(Self::Unknown),
181 "YES" => Some(Self::Yes),
182 "NO" => Some(Self::No),
183 "GAUGE" => Some(Self::Gauge),
184 _ => None,
185 }
186 }
187 }
188 #[allow(clippy::derive_partial_eq_without_eq)]
190 #[derive(Clone, PartialEq, ::prost::Oneof)]
191 pub enum Count {
192 #[prost(uint64, tag = "1")]
193 CountInt(u64),
194 #[prost(double, tag = "2")]
195 CountFloat(f64),
196 }
197 #[allow(clippy::derive_partial_eq_without_eq)]
199 #[derive(Clone, PartialEq, ::prost::Oneof)]
200 pub enum ZeroCount {
201 #[prost(uint64, tag = "6")]
202 ZeroCountInt(u64),
203 #[prost(double, tag = "7")]
204 ZeroCountFloat(f64),
205 }
206}
207#[allow(clippy::derive_partial_eq_without_eq)]
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct BucketSpan {
215 #[prost(sint32, tag = "1")]
217 pub offset: i32,
218 #[prost(uint32, tag = "2")]
220 pub length: u32,
221}
222#[allow(clippy::derive_partial_eq_without_eq)]
224#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct TimeSeries {
226 #[prost(message, repeated, tag = "1")]
229 pub labels: ::prost::alloc::vec::Vec<Label>,
230 #[prost(message, repeated, tag = "2")]
231 pub samples: ::prost::alloc::vec::Vec<Sample>,
232 #[prost(message, repeated, tag = "3")]
233 pub exemplars: ::prost::alloc::vec::Vec<Exemplar>,
234 #[prost(message, repeated, tag = "4")]
235 pub histograms: ::prost::alloc::vec::Vec<Histogram>,
236}
237#[allow(clippy::derive_partial_eq_without_eq)]
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct Label {
240 #[prost(string, tag = "1")]
241 pub name: ::prost::alloc::string::String,
242 #[prost(string, tag = "2")]
243 pub value: ::prost::alloc::string::String,
244}
245#[allow(clippy::derive_partial_eq_without_eq)]
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct Labels {
248 #[prost(message, repeated, tag = "1")]
249 pub labels: ::prost::alloc::vec::Vec<Label>,
250}
251#[allow(clippy::derive_partial_eq_without_eq)]
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct LabelMatcher {
255 #[prost(enumeration = "label_matcher::Type", tag = "1")]
256 pub r#type: i32,
257 #[prost(string, tag = "2")]
258 pub name: ::prost::alloc::string::String,
259 #[prost(string, tag = "3")]
260 pub value: ::prost::alloc::string::String,
261}
262pub mod label_matcher {
264 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
265 #[repr(i32)]
266 pub enum Type {
267 Eq = 0,
268 Neq = 1,
269 Re = 2,
270 Nre = 3,
271 }
272 impl Type {
273 pub fn as_str_name(&self) -> &'static str {
278 match self {
279 Type::Eq => "EQ",
280 Type::Neq => "NEQ",
281 Type::Re => "RE",
282 Type::Nre => "NRE",
283 }
284 }
285 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
287 match value {
288 "EQ" => Some(Self::Eq),
289 "NEQ" => Some(Self::Neq),
290 "RE" => Some(Self::Re),
291 "NRE" => Some(Self::Nre),
292 _ => None,
293 }
294 }
295 }
296}
297#[allow(clippy::derive_partial_eq_without_eq)]
298#[derive(Clone, PartialEq, ::prost::Message)]
299pub struct ReadHints {
300 #[prost(int64, tag = "1")]
302 pub step_ms: i64,
303 #[prost(string, tag = "2")]
305 pub func: ::prost::alloc::string::String,
306 #[prost(int64, tag = "3")]
308 pub start_ms: i64,
309 #[prost(int64, tag = "4")]
311 pub end_ms: i64,
312 #[prost(string, repeated, tag = "5")]
314 pub grouping: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
315 #[prost(bool, tag = "6")]
317 pub by: bool,
318 #[prost(int64, tag = "7")]
320 pub range_ms: i64,
321}
322#[allow(clippy::derive_partial_eq_without_eq)]
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct Chunk {
327 #[prost(int64, tag = "1")]
328 pub min_time_ms: i64,
329 #[prost(int64, tag = "2")]
330 pub max_time_ms: i64,
331 #[prost(enumeration = "chunk::Encoding", tag = "3")]
332 pub r#type: i32,
333 #[prost(bytes = "vec", tag = "4")]
334 pub data: ::prost::alloc::vec::Vec<u8>,
335}
336pub mod chunk {
338 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
340 #[repr(i32)]
341 pub enum Encoding {
342 Unknown = 0,
343 Xor = 1,
344 Histogram = 2,
345 }
346 impl Encoding {
347 pub fn as_str_name(&self) -> &'static str {
352 match self {
353 Encoding::Unknown => "UNKNOWN",
354 Encoding::Xor => "XOR",
355 Encoding::Histogram => "HISTOGRAM",
356 }
357 }
358 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
360 match value {
361 "UNKNOWN" => Some(Self::Unknown),
362 "XOR" => Some(Self::Xor),
363 "HISTOGRAM" => Some(Self::Histogram),
364 _ => None,
365 }
366 }
367 }
368}
369#[allow(clippy::derive_partial_eq_without_eq)]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChunkedSeries {
373 #[prost(message, repeated, tag = "1")]
375 pub labels: ::prost::alloc::vec::Vec<Label>,
376 #[prost(message, repeated, tag = "2")]
378 pub chunks: ::prost::alloc::vec::Vec<Chunk>,
379}
380#[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct WriteRequest {
383 #[prost(message, repeated, tag = "1")]
384 pub timeseries: ::prost::alloc::vec::Vec<TimeSeries>,
385 #[prost(message, repeated, tag = "3")]
386 pub metadata: ::prost::alloc::vec::Vec<MetricMetadata>,
387}
388#[allow(clippy::derive_partial_eq_without_eq)]
390#[derive(Clone, PartialEq, ::prost::Message)]
391pub struct ReadRequest {
392 #[prost(message, repeated, tag = "1")]
393 pub queries: ::prost::alloc::vec::Vec<Query>,
394 #[prost(enumeration = "read_request::ResponseType", repeated, tag = "2")]
400 pub accepted_response_types: ::prost::alloc::vec::Vec<i32>,
401}
402pub mod read_request {
404 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
405 #[repr(i32)]
406 pub enum ResponseType {
407 Samples = 0,
414 StreamedXorChunks = 1,
423 }
424 impl ResponseType {
425 pub fn as_str_name(&self) -> &'static str {
430 match self {
431 ResponseType::Samples => "SAMPLES",
432 ResponseType::StreamedXorChunks => "STREAMED_XOR_CHUNKS",
433 }
434 }
435 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
437 match value {
438 "SAMPLES" => Some(Self::Samples),
439 "STREAMED_XOR_CHUNKS" => Some(Self::StreamedXorChunks),
440 _ => None,
441 }
442 }
443 }
444}
445#[allow(clippy::derive_partial_eq_without_eq)]
447#[derive(Clone, PartialEq, ::prost::Message)]
448pub struct ReadResponse {
449 #[prost(message, repeated, tag = "1")]
451 pub results: ::prost::alloc::vec::Vec<QueryResult>,
452}
453#[allow(clippy::derive_partial_eq_without_eq)]
454#[derive(Clone, PartialEq, ::prost::Message)]
455pub struct Query {
456 #[prost(int64, tag = "1")]
457 pub start_timestamp_ms: i64,
458 #[prost(int64, tag = "2")]
459 pub end_timestamp_ms: i64,
460 #[prost(message, repeated, tag = "3")]
461 pub matchers: ::prost::alloc::vec::Vec<LabelMatcher>,
462 #[prost(message, optional, tag = "4")]
463 pub hints: ::core::option::Option<ReadHints>,
464}
465#[allow(clippy::derive_partial_eq_without_eq)]
466#[derive(Clone, PartialEq, ::prost::Message)]
467pub struct QueryResult {
468 #[prost(message, repeated, tag = "1")]
470 pub timeseries: ::prost::alloc::vec::Vec<TimeSeries>,
471}
472#[allow(clippy::derive_partial_eq_without_eq)]
477#[derive(Clone, PartialEq, ::prost::Message)]
478pub struct ChunkedReadResponse {
479 #[prost(message, repeated, tag = "1")]
480 pub chunked_series: ::prost::alloc::vec::Vec<ChunkedSeries>,
481 #[prost(int64, tag = "2")]
483 pub query_index: i64,
484}