Skip to content

Commit c7c7a69

Browse files
authored
Bump OTLP proto files to 1.2.0 (#5516)
1 parent e46a446 commit c7c7a69

File tree

2 files changed

+45
-14
lines changed
  • src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/opentelemetry/proto

2 files changed

+45
-14
lines changed

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/opentelemetry/proto/metrics/v1/metrics.proto

+9
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ message Metric {
188188
ExponentialHistogram exponential_histogram = 10;
189189
Summary summary = 11;
190190
}
191+
192+
// Additional metadata attributes that describe the metric. [Optional].
193+
// Attributes are non-identifying.
194+
// Consumers SHOULD NOT need to be aware of these attributes.
195+
// These attributes MAY be used to encode information allowing
196+
// for lossless roundtrip translation to / from another data model.
197+
// Attribute keys MUST be unique (it is not allowed to have more than one
198+
// attribute with the same key).
199+
repeated opentelemetry.proto.common.v1.KeyValue metadata = 12;
191200
}
192201

193202
// Gauge represents the type of a scalar metric that always exports the

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/opentelemetry/proto/trace/v1/trace.proto

+36-14
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,27 @@ message Span {
109109
// field must be empty. The ID is an 8-byte array.
110110
bytes parent_span_id = 4;
111111

112-
// Flags, a bit field. 8 least significant bits are the trace
113-
// flags as defined in W3C Trace Context specification. Readers
114-
// MUST not assume that 24 most significant bits will be zero.
115-
// To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
112+
// Flags, a bit field.
113+
//
114+
// Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
115+
// Context specification. To read the 8-bit W3C trace flag, use
116+
// `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
117+
//
118+
// See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
119+
//
120+
// Bits 8 and 9 represent the 3 states of whether a span's parent
121+
// is remote. The states are (unknown, is not remote, is remote).
122+
// To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
123+
// To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
116124
//
117125
// When creating span messages, if the message is logically forwarded from another source
118126
// with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD
119127
// be copied as-is. If creating from a source that does not have an equivalent flags field
120-
// (such as a runtime representation of an OpenTelemetry span), the high 24 bits MUST
128+
// (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST
121129
// be set to zero.
130+
// Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
122131
//
123132
// [Optional].
124-
//
125-
// See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
126133
fixed32 flags = 16;
127134

128135
// A description of the span's operation.
@@ -259,14 +266,23 @@ message Span {
259266
// then no attributes were dropped.
260267
uint32 dropped_attributes_count = 5;
261268

262-
// Flags, a bit field. 8 least significant bits are the trace
263-
// flags as defined in W3C Trace Context specification. Readers
264-
// MUST not assume that 24 most significant bits will be zero.
265-
// When creating new spans, the most-significant 24-bits MUST be
266-
// zero. To read the 8-bit W3C trace flag (use flags &
267-
// SPAN_FLAGS_TRACE_FLAGS_MASK). [Optional].
269+
// Flags, a bit field.
270+
//
271+
// Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
272+
// Context specification. To read the 8-bit W3C trace flag, use
273+
// `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.
268274
//
269275
// See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
276+
//
277+
// Bits 8 and 9 represent the 3 states of whether the link is remote.
278+
// The states are (unknown, is not remote, is remote).
279+
// To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`.
280+
// To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`.
281+
//
282+
// Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero.
283+
// When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero.
284+
//
285+
// [Optional].
270286
fixed32 flags = 6;
271287
}
272288

@@ -329,5 +345,11 @@ enum SpanFlags {
329345
// Bits 0-7 are used for trace flags.
330346
SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF;
331347

332-
// Bits 8-31 are reserved for future use.
348+
// Bits 8 and 9 are used to indicate that the parent span or link span is remote.
349+
// Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known.
350+
// Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote.
351+
SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x00000100;
352+
SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x00000200;
353+
354+
// Bits 10-31 are reserved for future use.
333355
}

0 commit comments

Comments
 (0)