Skip to content

Commit dfb89a0

Browse files
michaelvanstratenjjjalkanen
authored andcommitted
Bug 1991427 - Apply mozilla patches for opentelemetry-proto r=jari
Differential Revision: https://phabricator.services.mozilla.com/D266668
1 parent 2bdb19e commit dfb89a0

File tree

16 files changed

+12861
-0
lines changed

16 files changed

+12861
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// This file is @generated by prost-build.
2+
#[allow(clippy::derive_partial_eq_without_eq)]
3+
#[derive(Clone, PartialEq, ::prost::Message)]
4+
pub struct ExportTraceServiceRequest {
5+
/// An array of ResourceSpans.
6+
/// For data coming from a single resource this array will typically contain one
7+
/// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
8+
/// data from multiple origins typically batch the data before forwarding further and
9+
/// in that case this array will contain multiple elements.
10+
#[prost(message, repeated, tag = "1")]
11+
pub resource_spans: ::prost::alloc::vec::Vec<
12+
super::super::super::trace::v1::ResourceSpans,
13+
>,
14+
}
15+
#[allow(clippy::derive_partial_eq_without_eq)]
16+
#[derive(Clone, PartialEq, ::prost::Message)]
17+
pub struct ExportTraceServiceResponse {
18+
/// The details of a partially successful export request.
19+
///
20+
/// If the request is only partially accepted
21+
/// (i.e. when the server accepts only parts of the data and rejects the rest)
22+
/// the server MUST initialize the `partial_success` field and MUST
23+
/// set the `rejected_<signal>` with the number of items it rejected.
24+
///
25+
/// Servers MAY also make use of the `partial_success` field to convey
26+
/// warnings/suggestions to senders even when the request was fully accepted.
27+
/// In such cases, the `rejected_<signal>` MUST have a value of `0` and
28+
/// the `error_message` MUST be non-empty.
29+
///
30+
/// A `partial_success` message with an empty value (rejected_<signal> = 0 and
31+
/// `error_message` = "") is equivalent to it not being set/present. Senders
32+
/// SHOULD interpret it the same way as in the full success case.
33+
#[prost(message, optional, tag = "1")]
34+
pub partial_success: ::core::option::Option<ExportTracePartialSuccess>,
35+
}
36+
#[allow(clippy::derive_partial_eq_without_eq)]
37+
#[derive(Clone, PartialEq, ::prost::Message)]
38+
pub struct ExportTracePartialSuccess {
39+
/// The number of rejected spans.
40+
///
41+
/// A `rejected_<signal>` field holding a `0` value indicates that the
42+
/// request was fully accepted.
43+
#[prost(int64, tag = "1")]
44+
pub rejected_spans: i64,
45+
/// A developer-facing human-readable message in English. It should be used
46+
/// either to explain why the server rejected parts of the data during a partial
47+
/// success or to convey warnings/suggestions during a full success. The message
48+
/// should offer guidance on how users can address such issues.
49+
///
50+
/// error_message is an optional field. An error_message with an empty value
51+
/// is equivalent to it not being set.
52+
#[prost(string, tag = "2")]
53+
pub error_message: ::prost::alloc::string::String,
54+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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+
#[allow(clippy::derive_partial_eq_without_eq)]
6+
#[derive(Clone, PartialEq, ::prost::Message)]
7+
pub struct AnyValue {
8+
/// The value is one of the listed fields. It is valid for all values to be unspecified
9+
/// in which case this AnyValue is considered to be "empty".
10+
#[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
11+
pub value: ::core::option::Option<any_value::Value>,
12+
}
13+
/// Nested message and enum types in `AnyValue`.
14+
pub mod any_value {
15+
/// The value is one of the listed fields. It is valid for all values to be unspecified
16+
/// in which case this AnyValue is considered to be "empty".
17+
#[allow(clippy::derive_partial_eq_without_eq)]
18+
#[derive(Clone, PartialEq, ::prost::Oneof)]
19+
pub enum Value {
20+
#[prost(string, tag = "1")]
21+
StringValue(::prost::alloc::string::String),
22+
#[prost(bool, tag = "2")]
23+
BoolValue(bool),
24+
#[prost(int64, tag = "3")]
25+
IntValue(i64),
26+
#[prost(double, tag = "4")]
27+
DoubleValue(f64),
28+
#[prost(message, tag = "5")]
29+
ArrayValue(super::ArrayValue),
30+
#[prost(message, tag = "6")]
31+
KvlistValue(super::KeyValueList),
32+
#[prost(bytes, tag = "7")]
33+
BytesValue(::prost::alloc::vec::Vec<u8>),
34+
}
35+
}
36+
/// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
37+
/// since oneof in AnyValue does not allow repeated fields.
38+
#[allow(clippy::derive_partial_eq_without_eq)]
39+
#[derive(Clone, PartialEq, ::prost::Message)]
40+
pub struct ArrayValue {
41+
/// Array of values. The array may be empty (contain 0 elements).
42+
#[prost(message, repeated, tag = "1")]
43+
pub values: ::prost::alloc::vec::Vec<AnyValue>,
44+
}
45+
/// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
46+
/// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
47+
/// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
48+
/// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
49+
/// are semantically equivalent.
50+
#[allow(clippy::derive_partial_eq_without_eq)]
51+
#[derive(Clone, PartialEq, ::prost::Message)]
52+
pub struct KeyValueList {
53+
/// A collection of key/value pairs of key-value pairs. The list may be empty (may
54+
/// contain 0 elements).
55+
/// The keys MUST be unique (it is not allowed to have more than one
56+
/// value with the same key).
57+
#[prost(message, repeated, tag = "1")]
58+
pub values: ::prost::alloc::vec::Vec<KeyValue>,
59+
}
60+
/// KeyValue is a key-value pair that is used to store Span attributes, Link
61+
/// attributes, etc.
62+
#[allow(clippy::derive_partial_eq_without_eq)]
63+
#[derive(Clone, PartialEq, ::prost::Message)]
64+
pub struct KeyValue {
65+
#[prost(string, tag = "1")]
66+
pub key: ::prost::alloc::string::String,
67+
#[prost(message, optional, tag = "2")]
68+
pub value: ::core::option::Option<AnyValue>,
69+
}
70+
/// InstrumentationScope is a message representing the instrumentation scope information
71+
/// such as the fully qualified name and version.
72+
#[allow(clippy::derive_partial_eq_without_eq)]
73+
#[derive(Clone, PartialEq, ::prost::Message)]
74+
pub struct InstrumentationScope {
75+
/// An empty instrumentation scope name means the name is unknown.
76+
#[prost(string, tag = "1")]
77+
pub name: ::prost::alloc::string::String,
78+
#[prost(string, tag = "2")]
79+
pub version: ::prost::alloc::string::String,
80+
/// Additional attributes that describe the scope. \[Optional\].
81+
/// Attribute keys MUST be unique (it is not allowed to have more than one
82+
/// attribute with the same key).
83+
#[prost(message, repeated, tag = "3")]
84+
pub attributes: ::prost::alloc::vec::Vec<KeyValue>,
85+
#[prost(uint32, tag = "4")]
86+
pub dropped_attributes_count: u32,
87+
}
88+
/// A reference to an Entity.
89+
/// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
90+
///
91+
/// Status: \[Development\]
92+
#[allow(clippy::derive_partial_eq_without_eq)]
93+
#[derive(Clone, PartialEq, ::prost::Message)]
94+
pub struct EntityRef {
95+
/// The Schema URL, if known. This is the identifier of the Schema that the entity data
96+
/// is recorded in. To learn more about Schema URL see
97+
/// <https://opentelemetry.io/docs/specs/otel/schemas/#schema-url>
98+
///
99+
/// This schema_url applies to the data in this message and to the Resource attributes
100+
/// referenced by id_keys and description_keys.
101+
/// TODO: discuss if we are happy with this somewhat complicated definition of what
102+
/// the schema_url applies to.
103+
///
104+
/// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
105+
#[prost(string, tag = "1")]
106+
pub schema_url: ::prost::alloc::string::String,
107+
/// Defines the type of the entity. MUST not change during the lifetime of the entity.
108+
/// For example: "service" or "host". This field is required and MUST not be empty
109+
/// for valid entities.
110+
#[prost(string, tag = "2")]
111+
pub r#type: ::prost::alloc::string::String,
112+
/// Attribute Keys that identify the entity.
113+
/// MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
114+
/// These keys MUST exist in the containing {message}.attributes.
115+
#[prost(string, repeated, tag = "3")]
116+
pub id_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
117+
/// Descriptive (non-identifying) attribute keys of the entity.
118+
/// MAY change over the lifetime of the entity. MAY be empty.
119+
/// These attribute keys are not part of entity's identity.
120+
/// These keys MUST exist in the containing {message}.attributes.
121+
#[prost(string, repeated, tag = "4")]
122+
pub description_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
123+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// This file is @generated by prost-build.
2+
/// Resource information.
3+
#[allow(clippy::derive_partial_eq_without_eq)]
4+
#[derive(Clone, PartialEq, ::prost::Message)]
5+
pub struct Resource {
6+
/// Set of attributes that describe the resource.
7+
/// Attribute keys MUST be unique (it is not allowed to have more than one
8+
/// attribute with the same key).
9+
///
10+
/// The attribute values SHOULD NOT contain empty values.
11+
/// The attribute values SHOULD NOT contain bytes values.
12+
/// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
13+
/// double values.
14+
/// The attribute values SHOULD NOT contain kvlist values.
15+
/// The behavior of software that receives attributes containing such values can be unpredictable.
16+
/// These restrictions can change in a minor release.
17+
/// The restrictions take origin from the OpenTelemetry specification:
18+
/// <https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.>
19+
#[prost(message, repeated, tag = "1")]
20+
pub attributes: ::prost::alloc::vec::Vec<super::super::common::v1::KeyValue>,
21+
/// dropped_attributes_count is the number of dropped attributes. If the value is 0, then
22+
/// no attributes were dropped.
23+
#[prost(uint32, tag = "2")]
24+
pub dropped_attributes_count: u32,
25+
/// Set of entities that participate in this Resource.
26+
///
27+
/// Note: keys in the references MUST exist in attributes of this message.
28+
///
29+
/// Status: \[Development\]
30+
#[prost(message, repeated, tag = "3")]
31+
pub entity_refs: ::prost::alloc::vec::Vec<super::super::common::v1::EntityRef>,
32+
}

0 commit comments

Comments
 (0)