Skip to content

Commit 2a5ea62

Browse files
authored
Merge branch 'main' into patch-1
2 parents b4495f1 + 9242ed1 commit 2a5ea62

File tree

6 files changed

+52
-15
lines changed

6 files changed

+52
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ For GitHub groups see the [code owners](CODEOWNERS) file.
192192
* [Cijo Thomas](https://github.com/cijothomas)
193193
* [Harold Dost](https://github.com/hdost)
194194
* [Julian Tescher](https://github.com/jtescher)
195+
* [Lalit Kumar Bhasin](https://github.com/lalitb)
195196
* [Zhongyang Wu](https://github.com/TommyCpp)
196197

197198
### Approvers
198199

199-
* [Lalit Kumar Bhasin](https://github.com/lalitb)
200200
* [Shaun Cox](https://github.com/shaun-cox)
201201

202202
### Emeritus

opentelemetry-proto/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## vNext
44

5+
- Update protobuf definitions to v1.1.0 [#1668](https://github.com/open-telemetry/opentelemetry-rust/pull/1668)
6+
57
## v0.5.0
68

79
### Changed

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.metrics.v1.rs

+9
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ pub struct Metric {
168168
/// described by <http://unitsofmeasure.org/ucum.html.>
169169
#[prost(string, tag = "3")]
170170
pub unit: ::prost::alloc::string::String,
171+
/// Additional metadata attributes that describe the metric. \[Optional\].
172+
/// Attributes are non-identifying.
173+
/// Consumers SHOULD NOT need to be aware of these attributes.
174+
/// These attributes MAY be used to encode information allowing
175+
/// for lossless roundtrip translation to / from another data model.
176+
/// Attribute keys MUST be unique (it is not allowed to have more than one
177+
/// attribute with the same key).
178+
#[prost(message, repeated, tag = "12")]
179+
pub metadata: ::prost::alloc::vec::Vec<super::super::common::v1::KeyValue>,
171180
/// Data determines the aggregation type (if any) of the metric, what is the
172181
/// reported value type for the data points, as well as the relatationship to
173182
/// the time interval over which they are reported.

opentelemetry-proto/src/proto/tonic/opentelemetry.proto.trace.v1.rs

+38-13
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,27 @@ pub struct Span {
125125
)
126126
)]
127127
pub parent_span_id: ::prost::alloc::vec::Vec<u8>,
128-
/// Flags, a bit field. 8 least significant bits are the trace
129-
/// flags as defined in W3C Trace Context specification. Readers
130-
/// MUST not assume that 24 most significant bits will be zero.
131-
/// To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
128+
/// Flags, a bit field.
129+
///
130+
/// Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
131+
/// Context specification. To read the 8-bit W3C trace flag, use
132+
/// `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
133+
///
134+
/// See <https://www.w3.org/TR/trace-context-2/#trace-flags> for the flag definitions.
135+
///
136+
/// Bits 8 and 9 represent the 3 states of whether a span's parent
137+
/// is remote. The states are (unknown, is not remote, is remote).
138+
/// To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
139+
/// To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
132140
///
133141
/// When creating span messages, if the message is logically forwarded from another source
134142
/// with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD
135143
/// be copied as-is. If creating from a source that does not have an equivalent flags field
136-
/// (such as a runtime representation of an OpenTelemetry span), the high 24 bits MUST
144+
/// (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST
137145
/// be set to zero.
146+
/// Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
138147
///
139148
/// \[Optional\].
140-
///
141-
/// See <https://www.w3.org/TR/trace-context-2/#trace-flags> for the flag definitions.
142149
#[prost(fixed32, tag = "16")]
143150
pub flags: u32,
144151
/// A description of the span's operation.
@@ -297,14 +304,23 @@ pub mod span {
297304
/// then no attributes were dropped.
298305
#[prost(uint32, tag = "5")]
299306
pub dropped_attributes_count: u32,
300-
/// Flags, a bit field. 8 least significant bits are the trace
301-
/// flags as defined in W3C Trace Context specification. Readers
302-
/// MUST not assume that 24 most significant bits will be zero.
303-
/// When creating new spans, the most-significant 24-bits MUST be
304-
/// zero. To read the 8-bit W3C trace flag (use flags &
305-
/// SPAN_FLAGS_TRACE_FLAGS_MASK). \[Optional\].
307+
/// Flags, a bit field.
308+
///
309+
/// Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
310+
/// Context specification. To read the 8-bit W3C trace flag, use
311+
/// `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
306312
///
307313
/// See <https://www.w3.org/TR/trace-context-2/#trace-flags> for the flag definitions.
314+
///
315+
/// Bits 8 and 9 represent the 3 states of whether the link is remote.
316+
/// The states are (unknown, is not remote, is remote).
317+
/// To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
318+
/// To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
319+
///
320+
/// Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
321+
/// When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero.
322+
///
323+
/// \[Optional\].
308324
#[prost(fixed32, tag = "6")]
309325
pub flags: u32,
310326
}
@@ -468,6 +484,11 @@ pub enum SpanFlags {
468484
DoNotUse = 0,
469485
/// Bits 0-7 are used for trace flags.
470486
TraceFlagsMask = 255,
487+
/// Bits 8 and 9 are used to indicate that the parent span or link span is remote.
488+
/// Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known.
489+
/// Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote.
490+
ContextHasIsRemoteMask = 256,
491+
ContextIsRemoteMask = 512,
471492
}
472493
impl SpanFlags {
473494
/// String value of the enum field names used in the ProtoBuf definition.
@@ -478,13 +499,17 @@ impl SpanFlags {
478499
match self {
479500
SpanFlags::DoNotUse => "SPAN_FLAGS_DO_NOT_USE",
480501
SpanFlags::TraceFlagsMask => "SPAN_FLAGS_TRACE_FLAGS_MASK",
502+
SpanFlags::ContextHasIsRemoteMask => "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK",
503+
SpanFlags::ContextIsRemoteMask => "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK",
481504
}
482505
}
483506
/// Creates an enum from field names used in the ProtoBuf definition.
484507
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
485508
match value {
486509
"SPAN_FLAGS_DO_NOT_USE" => Some(Self::DoNotUse),
487510
"SPAN_FLAGS_TRACE_FLAGS_MASK" => Some(Self::TraceFlagsMask),
511+
"SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK" => Some(Self::ContextHasIsRemoteMask),
512+
"SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK" => Some(Self::ContextIsRemoteMask),
488513
_ => None,
489514
}
490515
}

opentelemetry-proto/src/transform/metrics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ pub mod tonic {
149149
name: metric.name.to_string(),
150150
description: metric.description.to_string(),
151151
unit: metric.unit.as_str().to_string(),
152+
metadata: vec![], // internal and currently unused
152153
data: metric.data.as_any().try_into().ok(),
153154
}
154155
}

0 commit comments

Comments
 (0)