opentelemetry_proto/proto/tonic/
opentelemetry.proto.common.v1.rs

1// This file is @generated by prost-build.
2/// AnyValue is used to represent any type of attribute value. AnyValue may contain a
3/// primitive value such as a string or integer or it may contain an arbitrary nested
4/// object containing arrays, key-value lists and primitives.
5#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
6#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
7#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct AnyValue {
10    /// The value is one of the listed fields. It is valid for all values to be unspecified
11    /// in which case this AnyValue is considered to be "empty".
12    #[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
13    #[cfg_attr(
14        feature = "with-serde",
15        serde(
16            flatten,
17            serialize_with = "crate::proto::serializers::serialize_to_value",
18            deserialize_with = "crate::proto::serializers::deserialize_from_value"
19        )
20    )]
21    pub value: ::core::option::Option<any_value::Value>,
22}
23/// Nested message and enum types in `AnyValue`.
24pub mod any_value {
25    /// The value is one of the listed fields. It is valid for all values to be unspecified
26    /// in which case this AnyValue is considered to be "empty".
27    #[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
28    #[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
29    #[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
30    #[derive(Clone, PartialEq, ::prost::Oneof)]
31    pub enum Value {
32        #[prost(string, tag = "1")]
33        StringValue(::prost::alloc::string::String),
34        #[prost(bool, tag = "2")]
35        BoolValue(bool),
36        #[prost(int64, tag = "3")]
37        IntValue(i64),
38        #[prost(double, tag = "4")]
39        DoubleValue(f64),
40        #[prost(message, tag = "5")]
41        ArrayValue(super::ArrayValue),
42        #[prost(message, tag = "6")]
43        KvlistValue(super::KeyValueList),
44        #[prost(bytes, tag = "7")]
45        BytesValue(::prost::alloc::vec::Vec<u8>),
46    }
47}
48/// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
49/// since oneof in AnyValue does not allow repeated fields.
50#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
51#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
52#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct ArrayValue {
55    /// Array of values. The array may be empty (contain 0 elements).
56    #[prost(message, repeated, tag = "1")]
57    pub values: ::prost::alloc::vec::Vec<AnyValue>,
58}
59/// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
60/// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
61/// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
62/// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
63/// are semantically equivalent.
64#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
65#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
66#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct KeyValueList {
69    /// A collection of key/value pairs of key-value pairs. The list may be empty (may
70    /// contain 0 elements).
71    /// The keys MUST be unique (it is not allowed to have more than one
72    /// value with the same key).
73    #[prost(message, repeated, tag = "1")]
74    pub values: ::prost::alloc::vec::Vec<KeyValue>,
75}
76/// KeyValue is a key-value pair that is used to store Span attributes, Link
77/// attributes, etc.
78#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
79#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
80#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
81#[derive(Clone, PartialEq, ::prost::Message)]
82pub struct KeyValue {
83    #[prost(string, tag = "1")]
84    pub key: ::prost::alloc::string::String,
85    #[prost(message, optional, tag = "2")]
86    pub value: ::core::option::Option<AnyValue>,
87}
88/// InstrumentationScope is a message representing the instrumentation scope information
89/// such as the fully qualified name and version.
90#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
91#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
92#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
93#[cfg_attr(feature = "with-serde", serde(default))]
94#[derive(Clone, PartialEq, ::prost::Message)]
95pub struct InstrumentationScope {
96    /// An empty instrumentation scope name means the name is unknown.
97    #[prost(string, tag = "1")]
98    pub name: ::prost::alloc::string::String,
99    #[prost(string, tag = "2")]
100    pub version: ::prost::alloc::string::String,
101    /// Additional attributes that describe the scope. \[Optional\].
102    /// Attribute keys MUST be unique (it is not allowed to have more than one
103    /// attribute with the same key).
104    #[prost(message, repeated, tag = "3")]
105    pub attributes: ::prost::alloc::vec::Vec<KeyValue>,
106    #[prost(uint32, tag = "4")]
107    pub dropped_attributes_count: u32,
108}