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}
109/// A reference to an Entity.
110/// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
111///
112/// Status: \[Development\]
113#[cfg_attr(feature = "with-schemars", derive(schemars::JsonSchema))]
114#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
115#[cfg_attr(feature = "with-serde", serde(rename_all = "camelCase"))]
116#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
117pub struct EntityRef {
118    /// The Schema URL, if known. This is the identifier of the Schema that the entity data
119    /// is recorded in. To learn more about Schema URL see
120    /// <https://opentelemetry.io/docs/specs/otel/schemas/#schema-url>
121    ///
122    /// This schema_url applies to the data in this message and to the Resource attributes
123    /// referenced by id_keys and description_keys.
124    /// TODO: discuss if we are happy with this somewhat complicated definition of what
125    /// the schema_url applies to.
126    ///
127    /// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
128    #[prost(string, tag = "1")]
129    pub schema_url: ::prost::alloc::string::String,
130    /// Defines the type of the entity. MUST not change during the lifetime of the entity.
131    /// For example: "service" or "host". This field is required and MUST not be empty
132    /// for valid entities.
133    #[prost(string, tag = "2")]
134    pub r#type: ::prost::alloc::string::String,
135    /// Attribute Keys that identify the entity.
136    /// MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
137    /// These keys MUST exist in the containing {message}.attributes.
138    #[prost(string, repeated, tag = "3")]
139    pub id_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
140    /// Descriptive (non-identifying) attribute keys of the entity.
141    /// MAY change over the lifetime of the entity. MAY be empty.
142    /// These attribute keys are not part of entity's identity.
143    /// These keys MUST exist in the containing {message}.attributes.
144    #[prost(string, repeated, tag = "4")]
145    pub description_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
146}