xds_api/generated/
io.prometheus.client.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct LabelPair {
4    #[prost(string, optional, tag = "1")]
5    pub name: ::core::option::Option<::prost::alloc::string::String>,
6    #[prost(string, optional, tag = "2")]
7    pub value: ::core::option::Option<::prost::alloc::string::String>,
8}
9impl ::prost::Name for LabelPair {
10    const NAME: &'static str = "LabelPair";
11    const PACKAGE: &'static str = "io.prometheus.client";
12    fn full_name() -> ::prost::alloc::string::String {
13        "io.prometheus.client.LabelPair".into()
14    }
15    fn type_url() -> ::prost::alloc::string::String {
16        "/io.prometheus.client.LabelPair".into()
17    }
18}
19#[derive(Clone, Copy, PartialEq, ::prost::Message)]
20pub struct Gauge {
21    #[prost(double, optional, tag = "1")]
22    pub value: ::core::option::Option<f64>,
23}
24impl ::prost::Name for Gauge {
25    const NAME: &'static str = "Gauge";
26    const PACKAGE: &'static str = "io.prometheus.client";
27    fn full_name() -> ::prost::alloc::string::String {
28        "io.prometheus.client.Gauge".into()
29    }
30    fn type_url() -> ::prost::alloc::string::String {
31        "/io.prometheus.client.Gauge".into()
32    }
33}
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct Counter {
36    #[prost(double, optional, tag = "1")]
37    pub value: ::core::option::Option<f64>,
38    #[prost(message, optional, tag = "2")]
39    pub exemplar: ::core::option::Option<Exemplar>,
40    #[prost(message, optional, tag = "3")]
41    pub created_timestamp: ::core::option::Option<
42        super::super::super::google::protobuf::Timestamp,
43    >,
44}
45impl ::prost::Name for Counter {
46    const NAME: &'static str = "Counter";
47    const PACKAGE: &'static str = "io.prometheus.client";
48    fn full_name() -> ::prost::alloc::string::String {
49        "io.prometheus.client.Counter".into()
50    }
51    fn type_url() -> ::prost::alloc::string::String {
52        "/io.prometheus.client.Counter".into()
53    }
54}
55#[derive(Clone, Copy, PartialEq, ::prost::Message)]
56pub struct Quantile {
57    #[prost(double, optional, tag = "1")]
58    pub quantile: ::core::option::Option<f64>,
59    #[prost(double, optional, tag = "2")]
60    pub value: ::core::option::Option<f64>,
61}
62impl ::prost::Name for Quantile {
63    const NAME: &'static str = "Quantile";
64    const PACKAGE: &'static str = "io.prometheus.client";
65    fn full_name() -> ::prost::alloc::string::String {
66        "io.prometheus.client.Quantile".into()
67    }
68    fn type_url() -> ::prost::alloc::string::String {
69        "/io.prometheus.client.Quantile".into()
70    }
71}
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct Summary {
74    #[prost(uint64, optional, tag = "1")]
75    pub sample_count: ::core::option::Option<u64>,
76    #[prost(double, optional, tag = "2")]
77    pub sample_sum: ::core::option::Option<f64>,
78    #[prost(message, repeated, tag = "3")]
79    pub quantile: ::prost::alloc::vec::Vec<Quantile>,
80    #[prost(message, optional, tag = "4")]
81    pub created_timestamp: ::core::option::Option<
82        super::super::super::google::protobuf::Timestamp,
83    >,
84}
85impl ::prost::Name for Summary {
86    const NAME: &'static str = "Summary";
87    const PACKAGE: &'static str = "io.prometheus.client";
88    fn full_name() -> ::prost::alloc::string::String {
89        "io.prometheus.client.Summary".into()
90    }
91    fn type_url() -> ::prost::alloc::string::String {
92        "/io.prometheus.client.Summary".into()
93    }
94}
95#[derive(Clone, Copy, PartialEq, ::prost::Message)]
96pub struct Untyped {
97    #[prost(double, optional, tag = "1")]
98    pub value: ::core::option::Option<f64>,
99}
100impl ::prost::Name for Untyped {
101    const NAME: &'static str = "Untyped";
102    const PACKAGE: &'static str = "io.prometheus.client";
103    fn full_name() -> ::prost::alloc::string::String {
104        "io.prometheus.client.Untyped".into()
105    }
106    fn type_url() -> ::prost::alloc::string::String {
107        "/io.prometheus.client.Untyped".into()
108    }
109}
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct Histogram {
112    #[prost(uint64, optional, tag = "1")]
113    pub sample_count: ::core::option::Option<u64>,
114    /// Overrides sample_count if > 0.
115    #[prost(double, optional, tag = "4")]
116    pub sample_count_float: ::core::option::Option<f64>,
117    #[prost(double, optional, tag = "2")]
118    pub sample_sum: ::core::option::Option<f64>,
119    /// Buckets for the conventional histogram.
120    ///
121    /// Ordered in increasing order of upper_bound, +Inf bucket is optional.
122    #[prost(message, repeated, tag = "3")]
123    pub bucket: ::prost::alloc::vec::Vec<Bucket>,
124    #[prost(message, optional, tag = "15")]
125    pub created_timestamp: ::core::option::Option<
126        super::super::super::google::protobuf::Timestamp,
127    >,
128    /// schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8.
129    /// They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
130    /// then each power of two is divided into 2^n logarithmic buckets.
131    /// Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
132    /// In the future, more bucket schemas may be added using numbers < -4 or > 8.
133    #[prost(sint32, optional, tag = "5")]
134    pub schema: ::core::option::Option<i32>,
135    /// Breadth of the zero bucket.
136    #[prost(double, optional, tag = "6")]
137    pub zero_threshold: ::core::option::Option<f64>,
138    /// Count in zero bucket.
139    #[prost(uint64, optional, tag = "7")]
140    pub zero_count: ::core::option::Option<u64>,
141    /// Overrides sb_zero_count if > 0.
142    #[prost(double, optional, tag = "8")]
143    pub zero_count_float: ::core::option::Option<f64>,
144    /// Negative buckets for the native histogram.
145    #[prost(message, repeated, tag = "9")]
146    pub negative_span: ::prost::alloc::vec::Vec<BucketSpan>,
147    /// Use either "negative_delta" or "negative_count", the former for
148    /// regular histograms with integer counts, the latter for float
149    /// histograms.
150    ///
151    /// Count delta of each bucket compared to previous one (or to zero for 1st bucket).
152    #[prost(sint64, repeated, packed = "false", tag = "10")]
153    pub negative_delta: ::prost::alloc::vec::Vec<i64>,
154    /// Absolute count of each bucket.
155    #[prost(double, repeated, packed = "false", tag = "11")]
156    pub negative_count: ::prost::alloc::vec::Vec<f64>,
157    /// Positive buckets for the native histogram.
158    /// Use a no-op span (offset 0, length 0) for a native histogram without any
159    /// observations yet and with a zero_threshold of 0. Otherwise, it would be
160    /// indistinguishable from a classic histogram.
161    #[prost(message, repeated, tag = "12")]
162    pub positive_span: ::prost::alloc::vec::Vec<BucketSpan>,
163    /// Use either "positive_delta" or "positive_count", the former for
164    /// regular histograms with integer counts, the latter for float
165    /// histograms.
166    ///
167    /// Count delta of each bucket compared to previous one (or to zero for 1st bucket).
168    #[prost(sint64, repeated, packed = "false", tag = "13")]
169    pub positive_delta: ::prost::alloc::vec::Vec<i64>,
170    /// Absolute count of each bucket.
171    #[prost(double, repeated, packed = "false", tag = "14")]
172    pub positive_count: ::prost::alloc::vec::Vec<f64>,
173    /// Only used for native histograms. These exemplars MUST have a timestamp.
174    #[prost(message, repeated, tag = "16")]
175    pub exemplars: ::prost::alloc::vec::Vec<Exemplar>,
176}
177impl ::prost::Name for Histogram {
178    const NAME: &'static str = "Histogram";
179    const PACKAGE: &'static str = "io.prometheus.client";
180    fn full_name() -> ::prost::alloc::string::String {
181        "io.prometheus.client.Histogram".into()
182    }
183    fn type_url() -> ::prost::alloc::string::String {
184        "/io.prometheus.client.Histogram".into()
185    }
186}
187/// A Bucket of a conventional histogram, each of which is treated as
188/// an individual counter-like time series by Prometheus.
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct Bucket {
191    /// Cumulative in increasing order.
192    #[prost(uint64, optional, tag = "1")]
193    pub cumulative_count: ::core::option::Option<u64>,
194    /// Overrides cumulative_count if > 0.
195    #[prost(double, optional, tag = "4")]
196    pub cumulative_count_float: ::core::option::Option<f64>,
197    /// Inclusive.
198    #[prost(double, optional, tag = "2")]
199    pub upper_bound: ::core::option::Option<f64>,
200    #[prost(message, optional, tag = "3")]
201    pub exemplar: ::core::option::Option<Exemplar>,
202}
203impl ::prost::Name for Bucket {
204    const NAME: &'static str = "Bucket";
205    const PACKAGE: &'static str = "io.prometheus.client";
206    fn full_name() -> ::prost::alloc::string::String {
207        "io.prometheus.client.Bucket".into()
208    }
209    fn type_url() -> ::prost::alloc::string::String {
210        "/io.prometheus.client.Bucket".into()
211    }
212}
213/// A BucketSpan defines a number of consecutive buckets in a native
214/// histogram with their offset. Logically, it would be more
215/// straightforward to include the bucket counts in the Span. However,
216/// the protobuf representation is more compact in the way the data is
217/// structured here (with all the buckets in a single array separate
218/// from the Spans).
219#[derive(Clone, Copy, PartialEq, ::prost::Message)]
220pub struct BucketSpan {
221    /// Gap to previous span, or starting point for 1st span (which can be negative).
222    #[prost(sint32, optional, tag = "1")]
223    pub offset: ::core::option::Option<i32>,
224    /// Length of consecutive buckets.
225    #[prost(uint32, optional, tag = "2")]
226    pub length: ::core::option::Option<u32>,
227}
228impl ::prost::Name for BucketSpan {
229    const NAME: &'static str = "BucketSpan";
230    const PACKAGE: &'static str = "io.prometheus.client";
231    fn full_name() -> ::prost::alloc::string::String {
232        "io.prometheus.client.BucketSpan".into()
233    }
234    fn type_url() -> ::prost::alloc::string::String {
235        "/io.prometheus.client.BucketSpan".into()
236    }
237}
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct Exemplar {
240    #[prost(message, repeated, tag = "1")]
241    pub label: ::prost::alloc::vec::Vec<LabelPair>,
242    #[prost(double, optional, tag = "2")]
243    pub value: ::core::option::Option<f64>,
244    /// OpenMetrics-style.
245    #[prost(message, optional, tag = "3")]
246    pub timestamp: ::core::option::Option<
247        super::super::super::google::protobuf::Timestamp,
248    >,
249}
250impl ::prost::Name for Exemplar {
251    const NAME: &'static str = "Exemplar";
252    const PACKAGE: &'static str = "io.prometheus.client";
253    fn full_name() -> ::prost::alloc::string::String {
254        "io.prometheus.client.Exemplar".into()
255    }
256    fn type_url() -> ::prost::alloc::string::String {
257        "/io.prometheus.client.Exemplar".into()
258    }
259}
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct Metric {
262    #[prost(message, repeated, tag = "1")]
263    pub label: ::prost::alloc::vec::Vec<LabelPair>,
264    #[prost(message, optional, tag = "2")]
265    pub gauge: ::core::option::Option<Gauge>,
266    #[prost(message, optional, tag = "3")]
267    pub counter: ::core::option::Option<Counter>,
268    #[prost(message, optional, tag = "4")]
269    pub summary: ::core::option::Option<Summary>,
270    #[prost(message, optional, tag = "5")]
271    pub untyped: ::core::option::Option<Untyped>,
272    #[prost(message, optional, tag = "7")]
273    pub histogram: ::core::option::Option<Histogram>,
274    #[prost(int64, optional, tag = "6")]
275    pub timestamp_ms: ::core::option::Option<i64>,
276}
277impl ::prost::Name for Metric {
278    const NAME: &'static str = "Metric";
279    const PACKAGE: &'static str = "io.prometheus.client";
280    fn full_name() -> ::prost::alloc::string::String {
281        "io.prometheus.client.Metric".into()
282    }
283    fn type_url() -> ::prost::alloc::string::String {
284        "/io.prometheus.client.Metric".into()
285    }
286}
287#[derive(Clone, PartialEq, ::prost::Message)]
288pub struct MetricFamily {
289    #[prost(string, optional, tag = "1")]
290    pub name: ::core::option::Option<::prost::alloc::string::String>,
291    #[prost(string, optional, tag = "2")]
292    pub help: ::core::option::Option<::prost::alloc::string::String>,
293    #[prost(enumeration = "MetricType", optional, tag = "3")]
294    pub r#type: ::core::option::Option<i32>,
295    #[prost(message, repeated, tag = "4")]
296    pub metric: ::prost::alloc::vec::Vec<Metric>,
297    #[prost(string, optional, tag = "5")]
298    pub unit: ::core::option::Option<::prost::alloc::string::String>,
299}
300impl ::prost::Name for MetricFamily {
301    const NAME: &'static str = "MetricFamily";
302    const PACKAGE: &'static str = "io.prometheus.client";
303    fn full_name() -> ::prost::alloc::string::String {
304        "io.prometheus.client.MetricFamily".into()
305    }
306    fn type_url() -> ::prost::alloc::string::String {
307        "/io.prometheus.client.MetricFamily".into()
308    }
309}
310#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
311#[repr(i32)]
312pub enum MetricType {
313    /// COUNTER must use the Metric field "counter".
314    Counter = 0,
315    /// GAUGE must use the Metric field "gauge".
316    Gauge = 1,
317    /// SUMMARY must use the Metric field "summary".
318    Summary = 2,
319    /// UNTYPED must use the Metric field "untyped".
320    Untyped = 3,
321    /// HISTOGRAM must use the Metric field "histogram".
322    Histogram = 4,
323    /// GAUGE_HISTOGRAM must use the Metric field "histogram".
324    GaugeHistogram = 5,
325}
326impl MetricType {
327    /// String value of the enum field names used in the ProtoBuf definition.
328    ///
329    /// The values are not transformed in any way and thus are considered stable
330    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
331    pub fn as_str_name(&self) -> &'static str {
332        match self {
333            Self::Counter => "COUNTER",
334            Self::Gauge => "GAUGE",
335            Self::Summary => "SUMMARY",
336            Self::Untyped => "UNTYPED",
337            Self::Histogram => "HISTOGRAM",
338            Self::GaugeHistogram => "GAUGE_HISTOGRAM",
339        }
340    }
341    /// Creates an enum from field names used in the ProtoBuf definition.
342    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
343        match value {
344            "COUNTER" => Some(Self::Counter),
345            "GAUGE" => Some(Self::Gauge),
346            "SUMMARY" => Some(Self::Summary),
347            "UNTYPED" => Some(Self::Untyped),
348            "HISTOGRAM" => Some(Self::Histogram),
349            "GAUGE_HISTOGRAM" => Some(Self::GaugeHistogram),
350            _ => None,
351        }
352    }
353}