envoy-types 0.7.3

Collection of protobuf types and other assets to work with the Envoy Proxy through Rust gRPC services.
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LabelPair {
    #[prost(string, optional, tag = "1")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub value: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for LabelPair {
    const NAME: &'static str = "LabelPair";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.LabelPair".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.LabelPair".into()
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Gauge {
    #[prost(double, optional, tag = "1")]
    pub value: ::core::option::Option<f64>,
}
impl ::prost::Name for Gauge {
    const NAME: &'static str = "Gauge";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Gauge".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Gauge".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Counter {
    #[prost(double, optional, tag = "1")]
    pub value: ::core::option::Option<f64>,
    #[prost(message, optional, tag = "2")]
    pub exemplar: ::core::option::Option<Exemplar>,
    #[prost(message, optional, tag = "3")]
    pub created_timestamp: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
impl ::prost::Name for Counter {
    const NAME: &'static str = "Counter";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Counter".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Counter".into()
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Quantile {
    #[prost(double, optional, tag = "1")]
    pub quantile: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "2")]
    pub value: ::core::option::Option<f64>,
}
impl ::prost::Name for Quantile {
    const NAME: &'static str = "Quantile";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Quantile".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Quantile".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Summary {
    #[prost(uint64, optional, tag = "1")]
    pub sample_count: ::core::option::Option<u64>,
    #[prost(double, optional, tag = "2")]
    pub sample_sum: ::core::option::Option<f64>,
    #[prost(message, repeated, tag = "3")]
    pub quantile: ::prost::alloc::vec::Vec<Quantile>,
    #[prost(message, optional, tag = "4")]
    pub created_timestamp: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
impl ::prost::Name for Summary {
    const NAME: &'static str = "Summary";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Summary".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Summary".into()
    }
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Untyped {
    #[prost(double, optional, tag = "1")]
    pub value: ::core::option::Option<f64>,
}
impl ::prost::Name for Untyped {
    const NAME: &'static str = "Untyped";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Untyped".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Untyped".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Histogram {
    #[prost(uint64, optional, tag = "1")]
    pub sample_count: ::core::option::Option<u64>,
    /// Overrides sample_count if > 0.
    #[prost(double, optional, tag = "4")]
    pub sample_count_float: ::core::option::Option<f64>,
    #[prost(double, optional, tag = "2")]
    pub sample_sum: ::core::option::Option<f64>,
    /// Buckets for the conventional histogram.
    ///
    /// Ordered in increasing order of upper_bound, +Inf bucket is optional.
    #[prost(message, repeated, tag = "3")]
    pub bucket: ::prost::alloc::vec::Vec<Bucket>,
    #[prost(message, optional, tag = "15")]
    pub created_timestamp: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
    /// schema defines the bucket schema. Currently, valid numbers are -4 \<= n \<= 8.
    /// They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and
    /// then each power of two is divided into 2^n logarithmic buckets.
    /// Or in other words, each bucket boundary is the previous boundary times 2^(2^-n).
    /// In the future, more bucket schemas may be added using numbers \< -4 or > 8.
    #[prost(sint32, optional, tag = "5")]
    pub schema: ::core::option::Option<i32>,
    /// Breadth of the zero bucket.
    #[prost(double, optional, tag = "6")]
    pub zero_threshold: ::core::option::Option<f64>,
    /// Count in zero bucket.
    #[prost(uint64, optional, tag = "7")]
    pub zero_count: ::core::option::Option<u64>,
    /// Overrides sb_zero_count if > 0.
    #[prost(double, optional, tag = "8")]
    pub zero_count_float: ::core::option::Option<f64>,
    /// Negative buckets for the native histogram.
    #[prost(message, repeated, tag = "9")]
    pub negative_span: ::prost::alloc::vec::Vec<BucketSpan>,
    /// Use either "negative_delta" or "negative_count", the former for
    /// regular histograms with integer counts, the latter for float
    /// histograms.
    ///
    /// Count delta of each bucket compared to previous one (or to zero for 1st bucket).
    #[prost(sint64, repeated, packed = "false", tag = "10")]
    pub negative_delta: ::prost::alloc::vec::Vec<i64>,
    /// Absolute count of each bucket.
    #[prost(double, repeated, packed = "false", tag = "11")]
    pub negative_count: ::prost::alloc::vec::Vec<f64>,
    /// Positive buckets for the native histogram.
    /// Use a no-op span (offset 0, length 0) for a native histogram without any
    /// observations yet and with a zero_threshold of 0. Otherwise, it would be
    /// indistinguishable from a classic histogram.
    #[prost(message, repeated, tag = "12")]
    pub positive_span: ::prost::alloc::vec::Vec<BucketSpan>,
    /// Use either "positive_delta" or "positive_count", the former for
    /// regular histograms with integer counts, the latter for float
    /// histograms.
    ///
    /// Count delta of each bucket compared to previous one (or to zero for 1st bucket).
    #[prost(sint64, repeated, packed = "false", tag = "13")]
    pub positive_delta: ::prost::alloc::vec::Vec<i64>,
    /// Absolute count of each bucket.
    #[prost(double, repeated, packed = "false", tag = "14")]
    pub positive_count: ::prost::alloc::vec::Vec<f64>,
    /// Only used for native histograms. These exemplars MUST have a timestamp.
    #[prost(message, repeated, tag = "16")]
    pub exemplars: ::prost::alloc::vec::Vec<Exemplar>,
}
impl ::prost::Name for Histogram {
    const NAME: &'static str = "Histogram";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Histogram".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Histogram".into()
    }
}
/// A Bucket of a conventional histogram, each of which is treated as
/// an individual counter-like time series by Prometheus.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bucket {
    /// Cumulative in increasing order.
    #[prost(uint64, optional, tag = "1")]
    pub cumulative_count: ::core::option::Option<u64>,
    /// Overrides cumulative_count if > 0.
    #[prost(double, optional, tag = "4")]
    pub cumulative_count_float: ::core::option::Option<f64>,
    /// Inclusive.
    #[prost(double, optional, tag = "2")]
    pub upper_bound: ::core::option::Option<f64>,
    #[prost(message, optional, tag = "3")]
    pub exemplar: ::core::option::Option<Exemplar>,
}
impl ::prost::Name for Bucket {
    const NAME: &'static str = "Bucket";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Bucket".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Bucket".into()
    }
}
/// A BucketSpan defines a number of consecutive buckets in a native
/// histogram with their offset. Logically, it would be more
/// straightforward to include the bucket counts in the Span. However,
/// the protobuf representation is more compact in the way the data is
/// structured here (with all the buckets in a single array separate
/// from the Spans).
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BucketSpan {
    /// Gap to previous span, or starting point for 1st span (which can be negative).
    #[prost(sint32, optional, tag = "1")]
    pub offset: ::core::option::Option<i32>,
    /// Length of consecutive buckets.
    #[prost(uint32, optional, tag = "2")]
    pub length: ::core::option::Option<u32>,
}
impl ::prost::Name for BucketSpan {
    const NAME: &'static str = "BucketSpan";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.BucketSpan".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.BucketSpan".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Exemplar {
    #[prost(message, repeated, tag = "1")]
    pub label: ::prost::alloc::vec::Vec<LabelPair>,
    #[prost(double, optional, tag = "2")]
    pub value: ::core::option::Option<f64>,
    /// OpenMetrics-style.
    #[prost(message, optional, tag = "3")]
    pub timestamp: ::core::option::Option<
        super::super::super::google::protobuf::Timestamp,
    >,
}
impl ::prost::Name for Exemplar {
    const NAME: &'static str = "Exemplar";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Exemplar".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Exemplar".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metric {
    #[prost(message, repeated, tag = "1")]
    pub label: ::prost::alloc::vec::Vec<LabelPair>,
    #[prost(message, optional, tag = "2")]
    pub gauge: ::core::option::Option<Gauge>,
    #[prost(message, optional, tag = "3")]
    pub counter: ::core::option::Option<Counter>,
    #[prost(message, optional, tag = "4")]
    pub summary: ::core::option::Option<Summary>,
    #[prost(message, optional, tag = "5")]
    pub untyped: ::core::option::Option<Untyped>,
    #[prost(message, optional, tag = "7")]
    pub histogram: ::core::option::Option<Histogram>,
    #[prost(int64, optional, tag = "6")]
    pub timestamp_ms: ::core::option::Option<i64>,
}
impl ::prost::Name for Metric {
    const NAME: &'static str = "Metric";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.Metric".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.Metric".into()
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetricFamily {
    #[prost(string, optional, tag = "1")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub help: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "MetricType", optional, tag = "3")]
    pub r#type: ::core::option::Option<i32>,
    #[prost(message, repeated, tag = "4")]
    pub metric: ::prost::alloc::vec::Vec<Metric>,
    #[prost(string, optional, tag = "5")]
    pub unit: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for MetricFamily {
    const NAME: &'static str = "MetricFamily";
    const PACKAGE: &'static str = "io.prometheus.client";
    fn full_name() -> ::prost::alloc::string::String {
        "io.prometheus.client.MetricFamily".into()
    }
    fn type_url() -> ::prost::alloc::string::String {
        "type.googleapis.com/io.prometheus.client.MetricFamily".into()
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetricType {
    /// COUNTER must use the Metric field "counter".
    Counter = 0,
    /// GAUGE must use the Metric field "gauge".
    Gauge = 1,
    /// SUMMARY must use the Metric field "summary".
    Summary = 2,
    /// UNTYPED must use the Metric field "untyped".
    Untyped = 3,
    /// HISTOGRAM must use the Metric field "histogram".
    Histogram = 4,
    /// GAUGE_HISTOGRAM must use the Metric field "histogram".
    GaugeHistogram = 5,
}
impl MetricType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Counter => "COUNTER",
            Self::Gauge => "GAUGE",
            Self::Summary => "SUMMARY",
            Self::Untyped => "UNTYPED",
            Self::Histogram => "HISTOGRAM",
            Self::GaugeHistogram => "GAUGE_HISTOGRAM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "COUNTER" => Some(Self::Counter),
            "GAUGE" => Some(Self::Gauge),
            "SUMMARY" => Some(Self::Summary),
            "UNTYPED" => Some(Self::Untyped),
            "HISTOGRAM" => Some(Self::Histogram),
            "GAUGE_HISTOGRAM" => Some(Self::GaugeHistogram),
            _ => None,
        }
    }
}