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