1#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct MetricMetadata {
8 #[prost(enumeration = "metric_metadata::MetricType", tag = "1")]
11 pub r#type: i32,
12 #[prost(string, tag = "2")]
13 pub metric_family_name: ::prost::alloc::string::String,
14 #[prost(string, tag = "4")]
15 pub help: ::prost::alloc::string::String,
16 #[prost(string, tag = "5")]
17 pub unit: ::prost::alloc::string::String,
18}
19pub mod metric_metadata {
21 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
22 #[repr(i32)]
23 pub enum MetricType {
24 Unknown = 0,
25 Counter = 1,
26 Gauge = 2,
27 Histogram = 3,
28 Gaugehistogram = 4,
29 Summary = 5,
30 Info = 6,
31 Stateset = 7,
32 }
33 impl MetricType {
34 pub fn as_str_name(&self) -> &'static str {
41 match self {
42 MetricType::Unknown => "UNKNOWN",
43 MetricType::Counter => "COUNTER",
44 MetricType::Gauge => "GAUGE",
45 MetricType::Histogram => "HISTOGRAM",
46 MetricType::Gaugehistogram => "GAUGEHISTOGRAM",
47 MetricType::Summary => "SUMMARY",
48 MetricType::Info => "INFO",
49 MetricType::Stateset => "STATESET",
50 }
51 }
52 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
54 match value {
55 "UNKNOWN" => Some(Self::Unknown),
56 "COUNTER" => Some(Self::Counter),
57 "GAUGE" => Some(Self::Gauge),
58 "HISTOGRAM" => Some(Self::Histogram),
59 "GAUGEHISTOGRAM" => Some(Self::Gaugehistogram),
60 "SUMMARY" => Some(Self::Summary),
61 "INFO" => Some(Self::Info),
62 "STATESET" => Some(Self::Stateset),
63 _ => None,
64 }
65 }
66 }
67}
68#[allow(clippy::derive_partial_eq_without_eq)]
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct Sample {
71 #[prost(double, tag = "1")]
72 pub value: f64,
73 #[prost(int64, tag = "2")]
76 pub timestamp: i64,
77}
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct Exemplar {
81 #[prost(message, repeated, tag = "1")]
83 pub labels: ::prost::alloc::vec::Vec<Label>,
84 #[prost(double, tag = "2")]
85 pub value: f64,
86 #[prost(int64, tag = "3")]
89 pub timestamp: i64,
90}
91#[allow(clippy::derive_partial_eq_without_eq)]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct Histogram {
100 #[prost(double, tag = "3")]
102 pub sum: f64,
103 #[prost(sint32, tag = "4")]
111 pub schema: i32,
112 #[prost(double, tag = "5")]
114 pub zero_threshold: f64,
115 #[prost(message, repeated, tag = "8")]
117 pub negative_spans: ::prost::alloc::vec::Vec<BucketSpan>,
118 #[prost(sint64, repeated, tag = "9")]
125 pub negative_deltas: ::prost::alloc::vec::Vec<i64>,
126 #[prost(double, repeated, tag = "10")]
128 pub negative_counts: ::prost::alloc::vec::Vec<f64>,
129 #[prost(message, repeated, tag = "11")]
131 pub positive_spans: ::prost::alloc::vec::Vec<BucketSpan>,
132 #[prost(sint64, repeated, tag = "12")]
139 pub positive_deltas: ::prost::alloc::vec::Vec<i64>,
140 #[prost(double, repeated, tag = "13")]
142 pub positive_counts: ::prost::alloc::vec::Vec<f64>,
143 #[prost(enumeration = "histogram::ResetHint", tag = "14")]
144 pub reset_hint: i32,
145 #[prost(int64, tag = "15")]
148 pub timestamp: i64,
149 #[prost(oneof = "histogram::Count", tags = "1, 2")]
151 pub count: ::core::option::Option<histogram::Count>,
152 #[prost(oneof = "histogram::ZeroCount", tags = "6, 7")]
154 pub zero_count: ::core::option::Option<histogram::ZeroCount>,
155}
156pub mod histogram {
158 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
159 #[repr(i32)]
160 pub enum ResetHint {
161 Unknown = 0,
163 Yes = 1,
165 No = 2,
167 Gauge = 3,
169 }
170 impl ResetHint {
171 pub fn as_str_name(&self) -> &'static str {
178 match self {
179 ResetHint::Unknown => "UNKNOWN",
180 ResetHint::Yes => "YES",
181 ResetHint::No => "NO",
182 ResetHint::Gauge => "GAUGE",
183 }
184 }
185 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
187 match value {
188 "UNKNOWN" => Some(Self::Unknown),
189 "YES" => Some(Self::Yes),
190 "NO" => Some(Self::No),
191 "GAUGE" => Some(Self::Gauge),
192 _ => None,
193 }
194 }
195 }
196 #[allow(clippy::derive_partial_eq_without_eq)]
198 #[derive(Clone, PartialEq, ::prost::Oneof)]
199 pub enum Count {
200 #[prost(uint64, tag = "1")]
201 CountInt(u64),
202 #[prost(double, tag = "2")]
203 CountFloat(f64),
204 }
205 #[allow(clippy::derive_partial_eq_without_eq)]
207 #[derive(Clone, PartialEq, ::prost::Oneof)]
208 pub enum ZeroCount {
209 #[prost(uint64, tag = "6")]
210 ZeroCountInt(u64),
211 #[prost(double, tag = "7")]
212 ZeroCountFloat(f64),
213 }
214}
215#[allow(clippy::derive_partial_eq_without_eq)]
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct BucketSpan {
223 #[prost(sint32, tag = "1")]
226 pub offset: i32,
227 #[prost(uint32, tag = "2")]
229 pub length: u32,
230}
231#[allow(clippy::derive_partial_eq_without_eq)]
233#[derive(Clone, PartialEq, ::prost::Message)]
234pub struct TimeSeries {
235 #[prost(message, repeated, tag = "1")]
239 pub labels: ::prost::alloc::vec::Vec<Label>,
240 #[prost(message, repeated, tag = "2")]
241 pub samples: ::prost::alloc::vec::Vec<Sample>,
242 #[prost(message, repeated, tag = "3")]
243 pub exemplars: ::prost::alloc::vec::Vec<Exemplar>,
244 #[prost(message, repeated, tag = "4")]
245 pub histograms: ::prost::alloc::vec::Vec<Histogram>,
246}
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct Label {
250 #[prost(string, tag = "1")]
251 pub name: ::prost::alloc::string::String,
252 #[prost(string, tag = "2")]
253 pub value: ::prost::alloc::string::String,
254}
255#[allow(clippy::derive_partial_eq_without_eq)]
256#[derive(Clone, PartialEq, ::prost::Message)]
257pub struct Labels {
258 #[prost(message, repeated, tag = "1")]
259 pub labels: ::prost::alloc::vec::Vec<Label>,
260}
261#[allow(clippy::derive_partial_eq_without_eq)]
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct LabelMatcher {
265 #[prost(enumeration = "label_matcher::Type", tag = "1")]
266 pub r#type: i32,
267 #[prost(string, tag = "2")]
268 pub name: ::prost::alloc::string::String,
269 #[prost(string, tag = "3")]
270 pub value: ::prost::alloc::string::String,
271}
272pub mod label_matcher {
274 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
275 #[repr(i32)]
276 pub enum Type {
277 Eq = 0,
278 Neq = 1,
279 Re = 2,
280 Nre = 3,
281 }
282 impl Type {
283 pub fn as_str_name(&self) -> &'static str {
290 match self {
291 Type::Eq => "EQ",
292 Type::Neq => "NEQ",
293 Type::Re => "RE",
294 Type::Nre => "NRE",
295 }
296 }
297 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
299 match value {
300 "EQ" => Some(Self::Eq),
301 "NEQ" => Some(Self::Neq),
302 "RE" => Some(Self::Re),
303 "NRE" => Some(Self::Nre),
304 _ => None,
305 }
306 }
307 }
308}
309#[allow(clippy::derive_partial_eq_without_eq)]
310#[derive(Clone, PartialEq, ::prost::Message)]
311pub struct ReadHints {
312 #[prost(int64, tag = "1")]
314 pub step_ms: i64,
315 #[prost(string, tag = "2")]
317 pub func: ::prost::alloc::string::String,
318 #[prost(int64, tag = "3")]
320 pub start_ms: i64,
321 #[prost(int64, tag = "4")]
323 pub end_ms: i64,
324 #[prost(string, repeated, tag = "5")]
326 pub grouping: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
327 #[prost(bool, tag = "6")]
329 pub by: bool,
330 #[prost(int64, tag = "7")]
332 pub range_ms: i64,
333}
334#[allow(clippy::derive_partial_eq_without_eq)]
337#[derive(Clone, PartialEq, ::prost::Message)]
338pub struct Chunk {
339 #[prost(int64, tag = "1")]
340 pub min_time_ms: i64,
341 #[prost(int64, tag = "2")]
342 pub max_time_ms: i64,
343 #[prost(enumeration = "chunk::Encoding", tag = "3")]
344 pub r#type: i32,
345 #[prost(bytes = "vec", tag = "4")]
346 pub data: ::prost::alloc::vec::Vec<u8>,
347}
348pub mod chunk {
350 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
352 #[repr(i32)]
353 pub enum Encoding {
354 Unknown = 0,
355 Xor = 1,
356 Histogram = 2,
357 }
358 impl Encoding {
359 pub fn as_str_name(&self) -> &'static str {
366 match self {
367 Encoding::Unknown => "UNKNOWN",
368 Encoding::Xor => "XOR",
369 Encoding::Histogram => "HISTOGRAM",
370 }
371 }
372 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
374 match value {
375 "UNKNOWN" => Some(Self::Unknown),
376 "XOR" => Some(Self::Xor),
377 "HISTOGRAM" => Some(Self::Histogram),
378 _ => None,
379 }
380 }
381 }
382}
383#[allow(clippy::derive_partial_eq_without_eq)]
385#[derive(Clone, PartialEq, ::prost::Message)]
386pub struct ChunkedSeries {
387 #[prost(message, repeated, tag = "1")]
389 pub labels: ::prost::alloc::vec::Vec<Label>,
390 #[prost(message, repeated, tag = "2")]
392 pub chunks: ::prost::alloc::vec::Vec<Chunk>,
393}
394#[allow(clippy::derive_partial_eq_without_eq)]
395#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct WriteRequest {
397 #[prost(message, repeated, tag = "1")]
398 pub timeseries: ::prost::alloc::vec::Vec<TimeSeries>,
399 #[prost(message, repeated, tag = "3")]
400 pub metadata: ::prost::alloc::vec::Vec<MetricMetadata>,
401}
402#[allow(clippy::derive_partial_eq_without_eq)]
404#[derive(Clone, PartialEq, ::prost::Message)]
405pub struct ReadRequest {
406 #[prost(message, repeated, tag = "1")]
407 pub queries: ::prost::alloc::vec::Vec<Query>,
408 #[prost(enumeration = "read_request::ResponseType", repeated, tag = "2")]
416 pub accepted_response_types: ::prost::alloc::vec::Vec<i32>,
417}
418pub mod read_request {
420 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
421 #[repr(i32)]
422 pub enum ResponseType {
423 Samples = 0,
431 StreamedXorChunks = 1,
440 }
441 impl ResponseType {
442 pub fn as_str_name(&self) -> &'static str {
449 match self {
450 ResponseType::Samples => "SAMPLES",
451 ResponseType::StreamedXorChunks => "STREAMED_XOR_CHUNKS",
452 }
453 }
454 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
456 match value {
457 "SAMPLES" => Some(Self::Samples),
458 "STREAMED_XOR_CHUNKS" => Some(Self::StreamedXorChunks),
459 _ => None,
460 }
461 }
462 }
463}
464#[allow(clippy::derive_partial_eq_without_eq)]
466#[derive(Clone, PartialEq, ::prost::Message)]
467pub struct ReadResponse {
468 #[prost(message, repeated, tag = "1")]
470 pub results: ::prost::alloc::vec::Vec<QueryResult>,
471}
472#[allow(clippy::derive_partial_eq_without_eq)]
473#[derive(Clone, PartialEq, ::prost::Message)]
474pub struct Query {
475 #[prost(int64, tag = "1")]
476 pub start_timestamp_ms: i64,
477 #[prost(int64, tag = "2")]
478 pub end_timestamp_ms: i64,
479 #[prost(message, repeated, tag = "3")]
480 pub matchers: ::prost::alloc::vec::Vec<LabelMatcher>,
481 #[prost(message, optional, tag = "4")]
482 pub hints: ::core::option::Option<ReadHints>,
483}
484#[allow(clippy::derive_partial_eq_without_eq)]
485#[derive(Clone, PartialEq, ::prost::Message)]
486pub struct QueryResult {
487 #[prost(message, repeated, tag = "1")]
489 pub timeseries: ::prost::alloc::vec::Vec<TimeSeries>,
490}
491#[allow(clippy::derive_partial_eq_without_eq)]
498#[derive(Clone, PartialEq, ::prost::Message)]
499pub struct ChunkedReadResponse {
500 #[prost(message, repeated, tag = "1")]
501 pub chunked_series: ::prost::alloc::vec::Vec<ChunkedSeries>,
502 #[prost(int64, tag = "2")]
505 pub query_index: i64,
506}