From d1468b7700309cec0a3fdfffbfba4e84acf94072 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan Date: Thu, 17 Aug 2023 12:07:32 -0400 Subject: [PATCH 01/41] Add comment to explain schema_url fields Resolves https://github.com/open-telemetry/opentelemetry-proto/issues/502 --- opentelemetry/proto/logs/v1/logs.proto | 6 ++++++ opentelemetry/proto/metrics/v1/metrics.proto | 6 ++++++ opentelemetry/proto/trace/v1/trace.proto | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/opentelemetry/proto/logs/v1/logs.proto b/opentelemetry/proto/logs/v1/logs.proto index 0b4b64972..b6679b7ac 100644 --- a/opentelemetry/proto/logs/v1/logs.proto +++ b/opentelemetry/proto/logs/v1/logs.proto @@ -55,6 +55,9 @@ message ResourceLogs { // A list of ScopeLogs that originate from a resource. repeated ScopeLogs scope_logs = 2; + // The Schema URL, if known. This is the identifier of the Schema that the resource data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_logs" field which have their own schema_url field. string schema_url = 3; @@ -70,6 +73,9 @@ message ScopeLogs { // A list of log records. repeated LogRecord log_records = 2; + // The Schema URL, if known. This is the identifier of the Schema that the log data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to all logs in the "logs" field. string schema_url = 3; } diff --git a/opentelemetry/proto/metrics/v1/metrics.proto b/opentelemetry/proto/metrics/v1/metrics.proto index da986dda1..dee50d25e 100644 --- a/opentelemetry/proto/metrics/v1/metrics.proto +++ b/opentelemetry/proto/metrics/v1/metrics.proto @@ -55,6 +55,9 @@ message ResourceMetrics { // A list of metrics that originate from a resource. repeated ScopeMetrics scope_metrics = 2; + // The Schema URL, if known. This is the identifier of the Schema that the resource data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_metrics" field which have their own schema_url field. string schema_url = 3; @@ -70,6 +73,9 @@ message ScopeMetrics { // A list of metrics that originate from an instrumentation library. repeated Metric metrics = 2; + // The Schema URL, if known. This is the identifier of the Schema that the metric data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to all metrics in the "metrics" field. string schema_url = 3; } diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index b2869edc4..8af5743d7 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -55,6 +55,9 @@ message ResourceSpans { // A list of ScopeSpans that originate from a resource. repeated ScopeSpans scope_spans = 2; + // The Schema URL, if known. This is the identifier of the Schema that the resource data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_spans" field which have their own schema_url field. string schema_url = 3; @@ -70,6 +73,9 @@ message ScopeSpans { // A list of Spans that originate from an instrumentation scope. repeated Span spans = 2; + // The Schema URL, if known. This is the identifier of the Schema that the span data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url // This schema_url applies to all spans and span events in the "spans" field. string schema_url = 3; } From ac3242b03157295e4ee9e616af53b81517b06559 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Thu, 14 Sep 2023 08:48:13 -0700 Subject: [PATCH 02/41] Add W3C-specified trace flags to v1 Span proto (#503) --- CHANGELOG.md | 5 +++ opentelemetry/proto/logs/v1/logs.proto | 8 ++-- opentelemetry/proto/trace/v1/trace.proto | 51 ++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b93bd0618..470f1f43e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.0.0...main). +### Added + +* Add a field for W3C-specified Trace Context flags to the `Span` and `Link`. + [#503](https://github.com/open-telemetry/opentelemetry-proto/pull/503) + ## 1.0.0 - 2023-07-03 Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v0.20.0...v1.0.0). diff --git a/opentelemetry/proto/logs/v1/logs.proto b/opentelemetry/proto/logs/v1/logs.proto index b6679b7ac..f9b97dd74 100644 --- a/opentelemetry/proto/logs/v1/logs.proto +++ b/opentelemetry/proto/logs/v1/logs.proto @@ -110,9 +110,11 @@ enum SeverityNumber { SEVERITY_NUMBER_FATAL4 = 24; } -// LogRecordFlags is defined as a protobuf 'uint32' type and is to be used as -// bit-fields. Each non-zero value defined in this enum is a bit-mask. -// To extract the bit-field, for example, use an expression like: +// LogRecordFlags represents constants used to interpret the +// LogRecord.flags field, which is protobuf 'fixed32' type and is to +// be used as bit-fields. Each non-zero value defined in this enum is +// a bit-mask. To extract the bit-field, for example, use an +// expression like: // // (logRecord.flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK) // diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 8af5743d7..a1fdfa3ac 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -109,6 +109,22 @@ message Span { // field must be empty. The ID is an 8-byte array. bytes parent_span_id = 4; + // Flags, a bit field. 8 least significant bits are the trace + // flags as defined in W3C Trace Context specification. Readers + // MUST not assume that 24 most significant bits will be zero. + // To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. + // + // When creating span messages, if the message is logically forwarded from another source + // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD + // be copied as-is. If creating from a source that does not have an equivalent flags field + // (such as a runtime representation of an OpenTelemetry span), the high 24 bits MUST + // be set to zero. + // + // [Optional]. + // + // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + fixed32 flags = 16; + // A description of the span's operation. // // For example, the name can be a qualified method name or a file name @@ -242,6 +258,16 @@ message Span { // dropped_attributes_count is the number of dropped attributes. If the value is 0, // then no attributes were dropped. uint32 dropped_attributes_count = 5; + + // Flags, a bit field. 8 least significant bits are the trace + // flags as defined in W3C Trace Context specification. Readers + // MUST not assume that 24 most significant bits will be zero. + // When creating new spans, the most-significant 24-bits MUST be + // zero. To read the 8-bit W3C trace flag (use flags & + // SPAN_FLAGS_TRACE_FLAGS_MASK). [Optional]. + // + // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + fixed32 flags = 6; } // links is a collection of Links, which are references from this span to a span @@ -280,3 +306,28 @@ message Status { // The status code. StatusCode code = 3; } + +// SpanFlags represents constants used to interpret the +// Span.flags field, which is protobuf 'fixed32' type and is to +// be used as bit-fields. Each non-zero value defined in this enum is +// a bit-mask. To extract the bit-field, for example, use an +// expression like: +// +// (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK) +// +// See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. +// +// Note that Span flags were introduced in version 1.1 of the +// OpenTelemetry protocol. Older Span producers do not set this +// field, consequently consumers should not rely on the absence of a +// particular flag bit to indicate the presence of a particular feature. +enum SpanFlags { + // The zero value for the enum. Should not be used for comparisons. + // Instead use bitwise "and" with the appropriate mask as shown above. + SPAN_FLAGS_DO_NOT_USE = 0; + + // Bits 0-7 are used for trace flags. + SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; + + // Bits 8-31 are reserved for future use. +} From f674adf15f7e779c6b83ef0dce240fa286b860d8 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:55:15 -0500 Subject: [PATCH 03/41] Remove irrelevant comments from metric name field (#512) --- opentelemetry/proto/metrics/v1/metrics.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/metrics/v1/metrics.proto b/opentelemetry/proto/metrics/v1/metrics.proto index dee50d25e..3394aee93 100644 --- a/opentelemetry/proto/metrics/v1/metrics.proto +++ b/opentelemetry/proto/metrics/v1/metrics.proto @@ -168,7 +168,7 @@ message ScopeMetrics { message Metric { reserved 4, 6, 8; - // name of the metric, including its DNS name prefix. It must be unique. + // name of the metric. string name = 1; // description of the metric, which can be used in documentation. From 189e5deecc4073d62273dfc91b8625bbbcb01243 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Fri, 27 Oct 2023 11:01:24 -0400 Subject: [PATCH 04/41] Fix the incorrect histogram example in metrics.json There are 2 buckets (-inf, 1), [1, +inf) but 3 bucket counts. --- examples/metrics.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/metrics.json b/examples/metrics.json index 2b4592205..feeacb50e 100644 --- a/examples/metrics.json +++ b/examples/metrics.json @@ -81,11 +81,11 @@ { "startTimeUnixNano": 1544712660300000000, "timeUnixNano": 1544712660300000000, - "count": 3, - "sum": 3, - "bucketCounts": [1,1,1], + "count": 2, + "sum": 2, + "bucketCounts": [1,1], "explicitBounds": [1], - "min": 1, + "min": 0, "max": 1, "attributes": [ { From ea449ae0e9b282f96ec12a09e796dbb3d390ed4f Mon Sep 17 00:00:00 2001 From: Yang Song Date: Fri, 27 Oct 2023 16:53:24 -0400 Subject: [PATCH 05/41] Update metrics.json --- examples/metrics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/metrics.json b/examples/metrics.json index feeacb50e..6704c3b57 100644 --- a/examples/metrics.json +++ b/examples/metrics.json @@ -86,7 +86,7 @@ "bucketCounts": [1,1], "explicitBounds": [1], "min": 0, - "max": 1, + "max": 2, "attributes": [ { "key": "my.histogram.attr", From c56093a326ec7d9c2436c778c50f656cb73b718c Mon Sep 17 00:00:00 2001 From: Ben Blackmore Date: Tue, 9 Jan 2024 20:14:14 +0100 Subject: [PATCH 06/41] fix: OTLP JSON examples (#516) # Why The example files do not follow the specification. 64 bit integers must be [string encoded](https://protobuf.dev/programming-guides/proto3/#json). # What - Fix the encoding in the examples - Add an example for log `severityNumber` to point at the enum encoding rules. --- examples/logs.json | 7 ++++--- examples/metrics.json | 10 +++++----- examples/trace.json | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/logs.json b/examples/logs.json index 8c7a84131..3fd771629 100644 --- a/examples/logs.json +++ b/examples/logs.json @@ -27,8 +27,9 @@ }, "logRecords": [ { - "timeUnixNano": 1544712660300000000, - "observedTimeUnixNano": 1544712660300000000, + "timeUnixNano": "1544712660300000000", + "observedTimeUnixNano": "1544712660300000000", + "severityNumber": 10, "severityText": "Information", "traceId": "5B8EFFF798038103D269B633813FC60C", "spanId": "EEE19B7EC3C1B174", @@ -51,7 +52,7 @@ { "key": "int.attribute", "value": { - "intValue": 10 + "intValue": "10" } }, { diff --git a/examples/metrics.json b/examples/metrics.json index 6704c3b57..36e0767d9 100644 --- a/examples/metrics.json +++ b/examples/metrics.json @@ -36,8 +36,8 @@ "dataPoints": [ { "asDouble": 5, - "startTimeUnixNano": 1544712660300000000, - "timeUnixNano": 1544712660300000000, + "startTimeUnixNano": "1544712660300000000", + "timeUnixNano": "1544712660300000000", "attributes": [ { "key": "my.counter.attr", @@ -58,7 +58,7 @@ "dataPoints": [ { "asDouble": 10, - "timeUnixNano": 1544712660300000000, + "timeUnixNano": "1544712660300000000", "attributes": [ { "key": "my.gauge.attr", @@ -79,8 +79,8 @@ "aggregationTemporality": 1, "dataPoints": [ { - "startTimeUnixNano": 1544712660300000000, - "timeUnixNano": 1544712660300000000, + "startTimeUnixNano": "1544712660300000000", + "timeUnixNano": "1544712660300000000", "count": 2, "sum": 2, "bucketCounts": [1,1], diff --git a/examples/trace.json b/examples/trace.json index 6d01eeefc..41130ff1a 100644 --- a/examples/trace.json +++ b/examples/trace.json @@ -31,8 +31,8 @@ "spanId": "EEE19B7EC3C1B174", "parentSpanId": "EEE19B7EC3C1B173", "name": "I'm a server span", - "startTimeUnixNano": 1544712660000000000, - "endTimeUnixNano": 1544712661000000000, + "startTimeUnixNano": "1544712660000000000", + "endTimeUnixNano": "1544712661000000000", "kind": 2, "attributes": [ { From 4ca4f0335c63cda7ab31ea7ed70d6553aee14dce Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Thu, 11 Jan 2024 08:54:12 -0800 Subject: [PATCH 07/41] Prepare release 1.1.0 (#523) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prepare release 1.1.0 Signed-off-by: Bogdan Drutu * Update CHANGELOG.md Co-authored-by: Piotr Kiełkowicz * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Yuri Shkuro --------- Signed-off-by: Bogdan Drutu Co-authored-by: Piotr Kiełkowicz Co-authored-by: Yuri Shkuro --- CHANGELOG.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 470f1f43e..ab793a015 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,25 @@ ## Unreleased -Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.0.0...main). +Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.1.0...main). + +## 1.1.0 - 2024-01-10 + +Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.0.0...v1.1.0). ### Added -* Add a field for W3C-specified Trace Context flags to the `Span` and `Link`. +* Add `flags` field to `Span` and `Span/Link` for W3C-specified Trace Context flags . [#503](https://github.com/open-telemetry/opentelemetry-proto/pull/503) +### Changed + +* Update and fix OTLP JSON examples. [#516](https://github.com/open-telemetry/opentelemetry-proto/pull/516), + [#510](https://github.com/open-telemetry/opentelemetry-proto/pull/510), + [#499](https://github.com/open-telemetry/opentelemetry-proto/pull/499) +* Remove irrelevant comments from metric name field. [#512](https://github.com/open-telemetry/opentelemetry-proto/pull/512) +* Add comment to explain schema_url fields. [#504](https://github.com/open-telemetry/opentelemetry-proto/pull/504) + ## 1.0.0 - 2023-07-03 Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v0.20.0...v1.0.0). From 34d29fe5ad4689b5db0259d3750de2bfa195bc85 Mon Sep 17 00:00:00 2001 From: Armin Ruech <7052238+arminru@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:29:14 +0100 Subject: [PATCH 08/41] Fix typo in requirements.md --- docs/requirements.md | 2 +- docs/specification.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.md b/docs/requirements.md index 5d1f1cb66..842ca77fe 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -84,7 +84,7 @@ Ideally it must also support very fast pass-through mode (when no modifications The protocol must impose minimal pressure on memory manager, including pass-through scenarios, when deserialized data is short-lived and must be serialized as-is shortly after and when such short-lived data is created and discarded at high frequency (think telemetry data forwarders). -The implementation of telemetry protocol must aim to minimize the number of memory allocations and dealocations performed during serialization and deserialization and aim to minimize the pressure on Garbage Collection (for GC languages). +The implementation of telemetry protocol must aim to minimize the number of memory allocations and deallocations performed during serialization and deserialization and aim to minimize the pressure on Garbage Collection (for GC languages). ### Level 7 Load Balancer Friendly diff --git a/docs/specification.md b/docs/specification.md index a4bcb13cc..d017eada4 100644 --- a/docs/specification.md +++ b/docs/specification.md @@ -5,7 +5,7 @@ aliases: - /docs/reference/specification/protocol/otlp - /docs/specs/otel/protocol/otlp spelling: - cSpell:ignore backoff backpressure dealocations errdetails nanos proto reconnections retryable + cSpell:ignore backoff backpressure errdetails nanos proto reconnections retryable cascade: body_class: otel-docs-spec github_repo: &repo https://github.com/open-telemetry/opentelemetry-proto From acc967d52c8485f0ae3338f2c311ee91a100b70c Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 13 Jun 2023 13:21:07 +0200 Subject: [PATCH 09/41] Add parent_span_is_remote to Span message --- opentelemetry/proto/trace/v1/trace.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index a1fdfa3ac..b000b3325 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -281,6 +281,12 @@ message Span { // An optional final status for this span. Semantically when Status isn't set, it means // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). Status status = 15; + + // parent_span_is_remote identifies whether a span's parent is remote or not. + // This helps determine whether a span can be considered an entry-point span. + // A span is an entry-point span if it has no parent (parent_span_id is empty), + // or if parent_span_is_remote is true. + bool parent_span_is_remote = 16; } // The Status type defines a logical error model that is suitable for different From 473303bdf6c79f03eb5cb1b7b210a3ad3ad37b7c Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 15 Aug 2023 12:07:31 +0200 Subject: [PATCH 10/41] Use enum for ParentSpanIsRemote --- opentelemetry/proto/trace/v1/trace.proto | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index b000b3325..afe8934b3 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -282,11 +282,24 @@ message Span { // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). Status status = 15; + // ParentSpanIsRemote indicates whether the span's parent is remote (true / false) or + // if the field is unset. + enum ParentIsRemote { + // Unset. + PARENT_SPAN_IS_REMOTE_UNSET = 0; + + // The parent span is not remote. + PARENT_SPAN_IS_REMOTE_FALSE = 1; + + // The parent span is remote. + PARENT_SPAN_IS_REMOTE_TRUE = 2; + } + // parent_span_is_remote identifies whether a span's parent is remote or not. // This helps determine whether a span can be considered an entry-point span. // A span is an entry-point span if it has no parent (parent_span_id is empty), - // or if parent_span_is_remote is true. - bool parent_span_is_remote = 16; + // or if parent_is_remote is true. + ParentSpanIsRemote parent_span_is_remote = 16; } // The Status type defines a logical error model that is suitable for different From a2a8f8bbe784d66afa9296b29a5950ed81bbd2a0 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 15 Aug 2023 12:10:07 +0200 Subject: [PATCH 11/41] Adjust enum name --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index afe8934b3..ba38229b0 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -284,7 +284,7 @@ message Span { // ParentSpanIsRemote indicates whether the span's parent is remote (true / false) or // if the field is unset. - enum ParentIsRemote { + enum ParentSpanIsRemote { // Unset. PARENT_SPAN_IS_REMOTE_UNSET = 0; From ef0a3b1b8a2030af3296b93f08787e25c76ac25e Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 15 Aug 2023 14:20:36 +0200 Subject: [PATCH 12/41] Add extra comment about unset value from older clients --- opentelemetry/proto/trace/v1/trace.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index ba38229b0..21e944398 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -285,7 +285,8 @@ message Span { // ParentSpanIsRemote indicates whether the span's parent is remote (true / false) or // if the field is unset. enum ParentSpanIsRemote { - // Unset. + // Unset. This value is expected from older clients. In which case, ParentSpanIsRemote + // can be derived by looking at the parent span and determining if it has a different Resource. PARENT_SPAN_IS_REMOTE_UNSET = 0; // The parent span is not remote. From bd30ca35990411fc47922cd3c0e1184974e685dc Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 22 Aug 2023 12:17:39 +0200 Subject: [PATCH 13/41] Remove misleading documentation --- opentelemetry/proto/trace/v1/trace.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 21e944398..bdf765e21 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -285,8 +285,7 @@ message Span { // ParentSpanIsRemote indicates whether the span's parent is remote (true / false) or // if the field is unset. enum ParentSpanIsRemote { - // Unset. This value is expected from older clients. In which case, ParentSpanIsRemote - // can be derived by looking at the parent span and determining if it has a different Resource. + // Unset. This value is expected from older clients. PARENT_SPAN_IS_REMOTE_UNSET = 0; // The parent span is not remote. From e75abec3bc7e0b4c060d4c355c25f22cf0418754 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 22 Aug 2023 12:19:11 +0200 Subject: [PATCH 14/41] Update names --- opentelemetry/proto/trace/v1/trace.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index bdf765e21..1e29f08b2 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -286,13 +286,13 @@ message Span { // if the field is unset. enum ParentSpanIsRemote { // Unset. This value is expected from older clients. - PARENT_SPAN_IS_REMOTE_UNSET = 0; + PARENT_SPAN_UNKNOWN_REMOTE = 0; // The parent span is not remote. - PARENT_SPAN_IS_REMOTE_FALSE = 1; + PARENT_SPAN_NOT_REMOTE = 1; // The parent span is remote. - PARENT_SPAN_IS_REMOTE_TRUE = 2; + PARENT_SPAN_REMOTE = 2; } // parent_span_is_remote identifies whether a span's parent is remote or not. From 123368f9c39983f3ad191c619f19917a0e48e73b Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Mon, 18 Sep 2023 16:18:40 +0200 Subject: [PATCH 15/41] Remove ParentSpanIsRemote attribute --- opentelemetry/proto/trace/v1/trace.proto | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 1e29f08b2..a1fdfa3ac 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -281,25 +281,6 @@ message Span { // An optional final status for this span. Semantically when Status isn't set, it means // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). Status status = 15; - - // ParentSpanIsRemote indicates whether the span's parent is remote (true / false) or - // if the field is unset. - enum ParentSpanIsRemote { - // Unset. This value is expected from older clients. - PARENT_SPAN_UNKNOWN_REMOTE = 0; - - // The parent span is not remote. - PARENT_SPAN_NOT_REMOTE = 1; - - // The parent span is remote. - PARENT_SPAN_REMOTE = 2; - } - - // parent_span_is_remote identifies whether a span's parent is remote or not. - // This helps determine whether a span can be considered an entry-point span. - // A span is an entry-point span if it has no parent (parent_span_id is empty), - // or if parent_is_remote is true. - ParentSpanIsRemote parent_span_is_remote = 16; } // The Status type defines a logical error model that is suitable for different From 095d37825199b891e1d9cf60bc66e83d948d0cc2 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Mon, 18 Sep 2023 16:20:45 +0200 Subject: [PATCH 16/41] Add defintion of 2 bit parent is remote flag --- opentelemetry/proto/trace/v1/trace.proto | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index a1fdfa3ac..6816d159c 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -123,6 +123,10 @@ message Span { // [Optional]. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + // + // Bits 8 and 9 are reserved for representing the 3 states of whether a span's parent + // is remote. The states are unknown, is not remote, is remote. + // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_IS_REMOTE_MASK`. fixed32 flags = 16; // A description of the span's operation. @@ -329,5 +333,8 @@ enum SpanFlags { // Bits 0-7 are used for trace flags. SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; - // Bits 8-31 are reserved for future use. + // Bits 8 and 9 are used for for the parent is remote flag. + SPAN_FLAGS_PARENT_IS_REMOTE_MASK = 0x00000300; + + // Bits 10-31 are reserved for future use. } From 3c37369fbbc68d1e9ebf3b8cff781e2222fd350f Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 19 Sep 2023 13:07:53 +0200 Subject: [PATCH 17/41] Include enum for interpreting ParentIsRemote flag and update documentation --- opentelemetry/proto/trace/v1/trace.proto | 38 ++++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 6816d159c..d80d770f9 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -109,24 +109,27 @@ message Span { // field must be empty. The ID is an 8-byte array. bytes parent_span_id = 4; - // Flags, a bit field. 8 least significant bits are the trace - // flags as defined in W3C Trace Context specification. Readers - // MUST not assume that 24 most significant bits will be zero. + // Flags, a bit field. Bits 0-7 (8 least significant bits) are the trace + // flags as defined in W3C Trace Context specification. // To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // When creating span messages, if the message is logically forwarded from another source // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD // be copied as-is. If creating from a source that does not have an equivalent flags field - // (such as a runtime representation of an OpenTelemetry span), the high 24 bits MUST + // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST // be set to zero. // // [Optional]. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // - // Bits 8 and 9 are reserved for representing the 3 states of whether a span's parent + // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are unknown, is not remote, is remote. // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_IS_REMOTE_MASK`. + // + // [Optional]. + // + // Readers MUST not assume that bits 10-31 (22 most significant bits) will be zero. fixed32 flags = 16; // A description of the span's operation. @@ -263,11 +266,11 @@ message Span { // then no attributes were dropped. uint32 dropped_attributes_count = 5; - // Flags, a bit field. 8 least significant bits are the trace + // Flags, a bit field. Bit 0-7 (8 least significant bits) are the trace // flags as defined in W3C Trace Context specification. Readers - // MUST not assume that 24 most significant bits will be zero. - // When creating new spans, the most-significant 24-bits MUST be - // zero. To read the 8-bit W3C trace flag (use flags & + // MUST not assume that bits 10-31 (22 most significant bits) will be zero. + // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be + // zero. To read the 8-bit W3C trace flag (use flags & // SPAN_FLAGS_TRACE_FLAGS_MASK). [Optional]. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. @@ -334,7 +337,24 @@ enum SpanFlags { SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; // Bits 8 and 9 are used for for the parent is remote flag. + // See SpanFlagsParentIsRemote for the valid values. SPAN_FLAGS_PARENT_IS_REMOTE_MASK = 0x00000300; // Bits 10-31 are reserved for future use. } + +// SpanFlagsParentIsRemote represents constants used to interpret +// bits 8 and 9 of the Span.flags field. These two bits represent whether +// the span's parent is remote. Bit 8 represents whether the field has been +// set and bit 9 represents whether the parent is remote. +// Once the bits have been read using SPAN_FLAGS_PARENT_IS_REMOTE_MASK, +// the following constants can be used to interpret them. +enum SpanFlagsParentIsRemote { + // Older clients may not set this field, so 00 represents that this value + // has not been set. + SPAN_FLAGS_PARENT_IS_REMOTE_UNKNOWN = 0; + // The parent is remote: 11 + SPAN_FLAGS_PARENT_IS_REMOTE = 0x00000300; + // The parent is not remote: 01 + SPAN_FLAGS_PARENT_IS_NOT_REMOTE = 0x00000100; +} From 0126795368380e7770158343c237243e188cdf9e Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Wed, 27 Sep 2023 16:22:07 +0200 Subject: [PATCH 18/41] Add constants and enum for interpreting bits 8 and 9 of a Link's flags --- opentelemetry/proto/trace/v1/trace.proto | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index d80d770f9..9500ae5af 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -274,6 +274,10 @@ message Span { // SPAN_FLAGS_TRACE_FLAGS_MASK). [Optional]. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. + // + // Bits 8 and 9 represent the 3 states of whether the link + // is remote. The states are unknown, is not remote, is remote. + // To read the 2-bit flag, use `flags & SPAN_FLAGS_LINK_IS_REMOTE_MASK`. fixed32 flags = 6; } @@ -340,6 +344,10 @@ enum SpanFlags { // See SpanFlagsParentIsRemote for the valid values. SPAN_FLAGS_PARENT_IS_REMOTE_MASK = 0x00000300; + // Bits 8 and 9 are used for for the link is remote flag. + // See SpanFlagsLinkIsRemote for the valid values. + SPAN_FLAGS_LINK_IS_REMOTE_MASK = 0x00000300; + // Bits 10-31 are reserved for future use. } @@ -358,3 +366,19 @@ enum SpanFlagsParentIsRemote { // The parent is not remote: 01 SPAN_FLAGS_PARENT_IS_NOT_REMOTE = 0x00000100; } + +// SpanFlagsLinkIsRemote represents constants used to interpret +// bits 8 and 9 of the Link.flags field. These two bits represent whether +// the link is remote. Bit 8 represents whether the field has been +// set and bit 9 represents whether the link is remote. +// Once the bits have been read using SPAN_FLAGS_LINK_IS_REMOTE_MASK, +// the following constants can be used to interpret them. +enum SpanFlagsLinkIsRemote { + // Older clients may not set this field, so 00 represents that this value + // has not been set. + SPAN_FLAGS_LINK_IS_REMOTE_UNKNOWN = 0; + // The linked span is remote: 11 + SPAN_FLAGS_LINK_IS_REMOTE = 0x00000300; + // The linked span is not remote: 01 + SPAN_FLAGS_LINK_IS_NOT_REMOTE = 0x00000100; +} From 3d7b4a4c421fb3057a0298cae37a90cf82d78451 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Wed, 27 Sep 2023 16:27:30 +0200 Subject: [PATCH 19/41] One constant for link and parent is remote mask --- opentelemetry/proto/trace/v1/trace.proto | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 9500ae5af..fedb7e9bd 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -125,7 +125,7 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are unknown, is not remote, is remote. - // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_IS_REMOTE_MASK`. + // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. // // [Optional]. // @@ -277,7 +277,7 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether the link // is remote. The states are unknown, is not remote, is remote. - // To read the 2-bit flag, use `flags & SPAN_FLAGS_LINK_IS_REMOTE_MASK`. + // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. fixed32 flags = 6; } @@ -340,13 +340,10 @@ enum SpanFlags { // Bits 0-7 are used for trace flags. SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; - // Bits 8 and 9 are used for for the parent is remote flag. - // See SpanFlagsParentIsRemote for the valid values. - SPAN_FLAGS_PARENT_IS_REMOTE_MASK = 0x00000300; - - // Bits 8 and 9 are used for for the link is remote flag. - // See SpanFlagsLinkIsRemote for the valid values. - SPAN_FLAGS_LINK_IS_REMOTE_MASK = 0x00000300; + // Bits 8 and 9 are used for the parent or link is remote flag. + // See SpanFlagsParentIsRemote and SpanFlagsLinkIsRemote for the + // valid values. + SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK = 0x00000300; // Bits 10-31 are reserved for future use. } @@ -355,7 +352,7 @@ enum SpanFlags { // bits 8 and 9 of the Span.flags field. These two bits represent whether // the span's parent is remote. Bit 8 represents whether the field has been // set and bit 9 represents whether the parent is remote. -// Once the bits have been read using SPAN_FLAGS_PARENT_IS_REMOTE_MASK, +// Once the bits have been read using SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK, // the following constants can be used to interpret them. enum SpanFlagsParentIsRemote { // Older clients may not set this field, so 00 represents that this value @@ -371,7 +368,7 @@ enum SpanFlagsParentIsRemote { // bits 8 and 9 of the Link.flags field. These two bits represent whether // the link is remote. Bit 8 represents whether the field has been // set and bit 9 represents whether the link is remote. -// Once the bits have been read using SPAN_FLAGS_LINK_IS_REMOTE_MASK, +// Once the bits have been read using SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK, // the following constants can be used to interpret them. enum SpanFlagsLinkIsRemote { // Older clients may not set this field, so 00 represents that this value From 09415118f9aec526ea51689cb52fb2035f0aa153 Mon Sep 17 00:00:00 2001 From: Emily S Date: Wed, 27 Sep 2023 17:49:09 +0200 Subject: [PATCH 20/41] Update opentelemetry/proto/trace/v1/trace.proto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Neumüller --- opentelemetry/proto/trace/v1/trace.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index fedb7e9bd..2bb74523c 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -127,9 +127,9 @@ message Span { // is remote. The states are unknown, is not remote, is remote. // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. // - // [Optional]. + // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // - // Readers MUST not assume that bits 10-31 (22 most significant bits) will be zero. + // [Optional]. fixed32 flags = 16; // A description of the span's operation. From 35e442efce0f9eea75c7dbff2255060c32e35d0f Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 28 Sep 2023 16:03:40 +0200 Subject: [PATCH 21/41] Adjust flags documentation ordering --- opentelemetry/proto/trace/v1/trace.proto | 33 ++++++++++++------------ 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 2bb74523c..bd0e42404 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -113,20 +113,17 @@ message Span { // flags as defined in W3C Trace Context specification. // To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // - // When creating span messages, if the message is logically forwarded from another source - // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD - // be copied as-is. If creating from a source that does not have an equivalent flags field - // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST - // be set to zero. - // - // [Optional]. - // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are unknown, is not remote, is remote. // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. // + // When creating span messages, if the message is logically forwarded from another source + // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD + // be copied as-is. If creating from a source that does not have an equivalent flags field + // (such as a runtime representation of an OpenTelemetry span), the high 22 bits MUST + // be set to zero. // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // // [Optional]. @@ -266,18 +263,20 @@ message Span { // then no attributes were dropped. uint32 dropped_attributes_count = 5; - // Flags, a bit field. Bit 0-7 (8 least significant bits) are the trace - // flags as defined in W3C Trace Context specification. Readers - // MUST not assume that bits 10-31 (22 most significant bits) will be zero. - // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be - // zero. To read the 8-bit W3C trace flag (use flags & - // SPAN_FLAGS_TRACE_FLAGS_MASK). [Optional]. + // Flags, a bit field. Bits 0-7 (8 least significant bits) are the trace + // flags as defined in W3C Trace Context specification. To read the 8-bit W3C trace + // flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // - // Bits 8 and 9 represent the 3 states of whether the link - // is remote. The states are unknown, is not remote, is remote. + // Bits 8 and 9 represent the 3 states of whether the link is remote. The states + // are unknown, is not remote, is remote. // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. + // + // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. + // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. + // + // [Optional]. fixed32 flags = 6; } @@ -340,7 +339,7 @@ enum SpanFlags { // Bits 0-7 are used for trace flags. SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; - // Bits 8 and 9 are used for the parent or link is remote flag. + // Bits 8 and 9 are used to indicate that the parent span or link span is remote. // See SpanFlagsParentIsRemote and SpanFlagsLinkIsRemote for the // valid values. SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK = 0x00000300; From fd386f1a8a5ddef0c14b4da5ca234fac7d8d71e4 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 28 Sep 2023 16:25:14 +0200 Subject: [PATCH 22/41] Merge parent and link is remote enums into one --- opentelemetry/proto/trace/v1/trace.proto | 40 +++++++----------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index bd0e42404..986a2c46d 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -340,41 +340,25 @@ enum SpanFlags { SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; // Bits 8 and 9 are used to indicate that the parent span or link span is remote. - // See SpanFlagsParentIsRemote and SpanFlagsLinkIsRemote for the - // valid values. + // See SpanFlagsParentOrLinkIsRemote for the valid values. SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK = 0x00000300; // Bits 10-31 are reserved for future use. } -// SpanFlagsParentIsRemote represents constants used to interpret -// bits 8 and 9 of the Span.flags field. These two bits represent whether -// the span's parent is remote. Bit 8 represents whether the field has been -// set and bit 9 represents whether the parent is remote. +// SpanFlagsParentOrLinkIsRemote represents constants used to interpret +// bits 8 and 9 of the Spans.flags or Link.flags field. These two bits +// represent whether the parent or link is remote. Bit 8 represents whether +// the field has been set and bit 9 represents whether the parent or link is +// remote. // Once the bits have been read using SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK, // the following constants can be used to interpret them. -enum SpanFlagsParentIsRemote { +enum SpanFlagsParentOrLinkIsRemote { // Older clients may not set this field, so 00 represents that this value // has not been set. - SPAN_FLAGS_PARENT_IS_REMOTE_UNKNOWN = 0; - // The parent is remote: 11 - SPAN_FLAGS_PARENT_IS_REMOTE = 0x00000300; - // The parent is not remote: 01 - SPAN_FLAGS_PARENT_IS_NOT_REMOTE = 0x00000100; -} - -// SpanFlagsLinkIsRemote represents constants used to interpret -// bits 8 and 9 of the Link.flags field. These two bits represent whether -// the link is remote. Bit 8 represents whether the field has been -// set and bit 9 represents whether the link is remote. -// Once the bits have been read using SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK, -// the following constants can be used to interpret them. -enum SpanFlagsLinkIsRemote { - // Older clients may not set this field, so 00 represents that this value - // has not been set. - SPAN_FLAGS_LINK_IS_REMOTE_UNKNOWN = 0; - // The linked span is remote: 11 - SPAN_FLAGS_LINK_IS_REMOTE = 0x00000300; - // The linked span is not remote: 01 - SPAN_FLAGS_LINK_IS_NOT_REMOTE = 0x00000100; + SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_UNKNOWN = 0; + // The parent or linked span is remote: 11 + SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE = 0x00000300; + // The parent or linked span is not remote: 01 + SPAN_FLAGS_PARENT_OR_LINK_IS_NOT_REMOTE = 0x00000100; } From a3cd7788a14e48be51a040a7f058ed9fba58bf3b Mon Sep 17 00:00:00 2001 From: Emily S Date: Thu, 12 Oct 2023 14:23:04 +0200 Subject: [PATCH 23/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 986a2c46d..07d192c89 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -353,7 +353,7 @@ enum SpanFlags { // remote. // Once the bits have been read using SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK, // the following constants can be used to interpret them. -enum SpanFlagsParentOrLinkIsRemote { +enum SpanFlagsContextIsRemote { // Older clients may not set this field, so 00 represents that this value // has not been set. SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_UNKNOWN = 0; From d0eb3f87b55d95089452596b8af556315cab3577 Mon Sep 17 00:00:00 2001 From: Emily S Date: Thu, 12 Oct 2023 14:23:15 +0200 Subject: [PATCH 24/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Joshua MacDonald --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 07d192c89..917e662e8 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -351,7 +351,7 @@ enum SpanFlags { // represent whether the parent or link is remote. Bit 8 represents whether // the field has been set and bit 9 represents whether the parent or link is // remote. -// Once the bits have been read using SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK, +// Once the bits have been read using SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK, // the following constants can be used to interpret them. enum SpanFlagsContextIsRemote { // Older clients may not set this field, so 00 represents that this value From 417402115371948defc990e7fe2bfd9249b9ab63 Mon Sep 17 00:00:00 2001 From: Emily S Date: Thu, 12 Oct 2023 14:23:26 +0200 Subject: [PATCH 25/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Joshua MacDonald --- opentelemetry/proto/trace/v1/trace.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 917e662e8..c8f5b1db6 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -356,9 +356,9 @@ enum SpanFlags { enum SpanFlagsContextIsRemote { // Older clients may not set this field, so 00 represents that this value // has not been set. - SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_UNKNOWN = 0; + SPAN_FLAGS_CONTEXT_IS_REMOTE_UNKNOWN = 0; // The parent or linked span is remote: 11 - SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE = 0x00000300; + SPAN_FLAGS_CONTEXT_IS_REMOTE = 0x00000300; // The parent or linked span is not remote: 01 - SPAN_FLAGS_PARENT_OR_LINK_IS_NOT_REMOTE = 0x00000100; + SPAN_FLAGS_CONTEXT_IS_NOT_REMOTE = 0x00000100; } From 964a94c191ee04c3c391a0346048bc4466946da4 Mon Sep 17 00:00:00 2001 From: Emily S Date: Thu, 12 Oct 2023 14:23:37 +0200 Subject: [PATCH 26/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Joshua MacDonald --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index c8f5b1db6..cb07920c7 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -271,7 +271,7 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether the link is remote. The states // are unknown, is not remote, is remote. - // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. + // To read the 2-bit flag, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. // // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. From e7829c59c17efc5077486e1f46be1cee23935e0d Mon Sep 17 00:00:00 2001 From: Emily S Date: Thu, 12 Oct 2023 14:23:47 +0200 Subject: [PATCH 27/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Joshua MacDonald --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index cb07920c7..eac4b99e1 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -341,7 +341,7 @@ enum SpanFlags { // Bits 8 and 9 are used to indicate that the parent span or link span is remote. // See SpanFlagsParentOrLinkIsRemote for the valid values. - SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK = 0x00000300; + SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x00000300; // Bits 10-31 are reserved for future use. } From 6b5d30a8d48cd38806cb88d3fbf5a1f1954ce967 Mon Sep 17 00:00:00 2001 From: Emily S Date: Thu, 12 Oct 2023 14:25:30 +0200 Subject: [PATCH 28/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Joshua MacDonald --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index eac4b99e1..7f98ec1e7 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -117,7 +117,7 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are unknown, is not remote, is remote. - // To read the 2-bit flag, use `flags & SPAN_FLAGS_PARENT_OR_LINK_IS_REMOTE_MASK`. + // To read the 2-bit flag, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. // // When creating span messages, if the message is logically forwarded from another source // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD From de281dec379431d98ed5622627fba0a7b36cd2a7 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 12 Oct 2023 14:29:28 +0200 Subject: [PATCH 29/41] Change doc references to updated enum name --- opentelemetry/proto/trace/v1/trace.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 7f98ec1e7..69e690f2c 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -340,13 +340,13 @@ enum SpanFlags { SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; // Bits 8 and 9 are used to indicate that the parent span or link span is remote. - // See SpanFlagsParentOrLinkIsRemote for the valid values. + // See SpanFlagsContextIsRemote for the valid values. SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x00000300; // Bits 10-31 are reserved for future use. } -// SpanFlagsParentOrLinkIsRemote represents constants used to interpret +// SpanFlagsContextIsRemote represents constants used to interpret // bits 8 and 9 of the Spans.flags or Link.flags field. These two bits // represent whether the parent or link is remote. Bit 8 represents whether // the field has been set and bit 9 represents whether the parent or link is From bd7b09e753b1141c4307059abcb3a01b3b0a901a Mon Sep 17 00:00:00 2001 From: Emily S Date: Mon, 16 Oct 2023 12:56:49 +0200 Subject: [PATCH 30/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- opentelemetry/proto/trace/v1/trace.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 69e690f2c..49db2dbe7 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -109,7 +109,9 @@ message Span { // field must be empty. The ID is an 8-byte array. bytes parent_span_id = 4; - // Flags, a bit field. Bits 0-7 (8 least significant bits) are the trace + // Flags, a bit field. + // + // Bits 0-7 (8 least significant bits) are the trace // flags as defined in W3C Trace Context specification. // To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // From 3a03077ede0b6d5b4a1ade9f1feb470822e1b7f0 Mon Sep 17 00:00:00 2001 From: Emily S Date: Mon, 16 Oct 2023 12:56:58 +0200 Subject: [PATCH 31/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> --- opentelemetry/proto/trace/v1/trace.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 49db2dbe7..a68eba6ce 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -118,7 +118,7 @@ message Span { // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // // Bits 8 and 9 represent the 3 states of whether a span's parent - // is remote. The states are unknown, is not remote, is remote. + // is remote. The states are (unknown, is not remote, is remote). // To read the 2-bit flag, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. // // When creating span messages, if the message is logically forwarded from another source From 28d81a413a5e0557a26862b96ffeec7e7cc3ef62 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Mon, 16 Oct 2023 13:00:23 +0200 Subject: [PATCH 32/41] Adjust formatting of comments --- opentelemetry/proto/trace/v1/trace.proto | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index a68eba6ce..cf0c0883f 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -109,11 +109,11 @@ message Span { // field must be empty. The ID is an 8-byte array. bytes parent_span_id = 4; - // Flags, a bit field. + // Flags, a bit field. // - // Bits 0-7 (8 least significant bits) are the trace - // flags as defined in W3C Trace Context specification. - // To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. + // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace + // Context specification. To read the 8-bit W3C trace flag, use + // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // @@ -265,9 +265,11 @@ message Span { // then no attributes were dropped. uint32 dropped_attributes_count = 5; - // Flags, a bit field. Bits 0-7 (8 least significant bits) are the trace - // flags as defined in W3C Trace Context specification. To read the 8-bit W3C trace - // flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. + // Flags, a bit field. + // + // Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace + // Context specification. To read the 8-bit W3C trace flag, use + // `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`. // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // From 6b2be209616bb6514a54cb2cbba78b17c7fd776a Mon Sep 17 00:00:00 2001 From: Emily S Date: Tue, 17 Oct 2023 22:15:53 +0200 Subject: [PATCH 33/41] Update opentelemetry/proto/trace/v1/trace.proto Co-authored-by: Johannes Tax --- opentelemetry/proto/trace/v1/trace.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index cf0c0883f..275c3b9e9 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -358,8 +358,8 @@ enum SpanFlags { // Once the bits have been read using SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK, // the following constants can be used to interpret them. enum SpanFlagsContextIsRemote { - // Older clients may not set this field, so 00 represents that this value - // has not been set. + // Older client not supporting this flag, or not known whether parent or + // linked span is remote: 00 SPAN_FLAGS_CONTEXT_IS_REMOTE_UNKNOWN = 0; // The parent or linked span is remote: 11 SPAN_FLAGS_CONTEXT_IS_REMOTE = 0x00000300; From 1635398361f4a4e3f40018d7d72ffef7725a5cd4 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 28 Nov 2023 14:21:49 -0500 Subject: [PATCH 34/41] Remove enum, describe values in comment --- opentelemetry/proto/trace/v1/trace.proto | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 275c3b9e9..b3750da2c 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -344,25 +344,9 @@ enum SpanFlags { SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; // Bits 8 and 9 are used to indicate that the parent span or link span is remote. - // See SpanFlagsContextIsRemote for the valid values. + // Bit 8 indicates whether the value is known. Bit 9 indicates whether the span + // or link is remote. SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x00000300; // Bits 10-31 are reserved for future use. } - -// SpanFlagsContextIsRemote represents constants used to interpret -// bits 8 and 9 of the Spans.flags or Link.flags field. These two bits -// represent whether the parent or link is remote. Bit 8 represents whether -// the field has been set and bit 9 represents whether the parent or link is -// remote. -// Once the bits have been read using SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK, -// the following constants can be used to interpret them. -enum SpanFlagsContextIsRemote { - // Older client not supporting this flag, or not known whether parent or - // linked span is remote: 00 - SPAN_FLAGS_CONTEXT_IS_REMOTE_UNKNOWN = 0; - // The parent or linked span is remote: 11 - SPAN_FLAGS_CONTEXT_IS_REMOTE = 0x00000300; - // The parent or linked span is not remote: 01 - SPAN_FLAGS_CONTEXT_IS_NOT_REMOTE = 0x00000100; -} From 7df29cd14f75fb5fd0573a80c074362053862bbe Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 11 Jan 2024 14:42:23 +0100 Subject: [PATCH 35/41] Split isremote into two masks --- opentelemetry/proto/trace/v1/trace.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index b3750da2c..c2c1a0217 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -344,9 +344,10 @@ enum SpanFlags { SPAN_FLAGS_TRACE_FLAGS_MASK = 0x000000FF; // Bits 8 and 9 are used to indicate that the parent span or link span is remote. - // Bit 8 indicates whether the value is known. Bit 9 indicates whether the span - // or link is remote. - SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x00000300; + // Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known. + // Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote. + SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x00000100; + SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x00000200; // Bits 10-31 are reserved for future use. } From 3299be0915d8c1f51dde191bdcd66a5075d02a3e Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 11 Jan 2024 14:47:00 +0100 Subject: [PATCH 36/41] Update references to isremote masks --- opentelemetry/proto/trace/v1/trace.proto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index c2c1a0217..104e2f597 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -119,7 +119,8 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are (unknown, is not remote, is remote). - // To read the 2-bit flag, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. + // To read whether the value is known, use `flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK`. + // To read whether the span is remote, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. // // When creating span messages, if the message is logically forwarded from another source // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD @@ -275,7 +276,8 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether the link is remote. The states // are unknown, is not remote, is remote. - // To read the 2-bit flag, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. + // To read whether the value is known, use `flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK`. + // To read whether the link is remote, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. // // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. From 9076d8f03209c2d1b4e25e376a96df772a200f8d Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Thu, 11 Jan 2024 14:48:36 +0100 Subject: [PATCH 37/41] Update inconsistency in docs formatting --- opentelemetry/proto/trace/v1/trace.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 104e2f597..2fa5b9fbd 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -274,8 +274,8 @@ message Span { // // See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. // - // Bits 8 and 9 represent the 3 states of whether the link is remote. The states - // are unknown, is not remote, is remote. + // Bits 8 and 9 represent the 3 states of whether the link is remote. + // The states are (unknown, is not remote, is remote). // To read whether the value is known, use `flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK`. // To read whether the link is remote, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. // From b5c1a7882180a26bb7794594e8546798ecb68103 Mon Sep 17 00:00:00 2001 From: Emily Stolfo Date: Tue, 23 Jan 2024 15:51:21 +0100 Subject: [PATCH 38/41] Add Changelog entry --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab793a015..f5d257a8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,10 @@ Full list of differences found in [this compare](https://github.com/open-telemet ### Added -* Add `flags` field to `Span` and `Span/Link` for W3C-specified Trace Context flags . +* Add `flags` field to `Span` and `Span/Link` for W3C-specified Trace Context flags. [#503](https://github.com/open-telemetry/opentelemetry-proto/pull/503) +* Indicate if a `Span`'s parent or link is remote using 2 bit flag. + [#484](https://github.com/open-telemetry/opentelemetry-proto/pull/484) ### Changed From 0a743e76ddbb34d7d46a4c3ca8f9d7bdbb81e389 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Tue, 30 Jan 2024 08:27:48 -0600 Subject: [PATCH 39/41] Clarify formulas for reading span flags (#528) * Add bitshift to comment for reading span flags * Change >> to != 0 --- opentelemetry/proto/trace/v1/trace.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opentelemetry/proto/trace/v1/trace.proto b/opentelemetry/proto/trace/v1/trace.proto index 2fa5b9fbd..5cb2f3ce1 100644 --- a/opentelemetry/proto/trace/v1/trace.proto +++ b/opentelemetry/proto/trace/v1/trace.proto @@ -119,8 +119,8 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether a span's parent // is remote. The states are (unknown, is not remote, is remote). - // To read whether the value is known, use `flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK`. - // To read whether the span is remote, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. + // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. + // To read whether the span is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. // // When creating span messages, if the message is logically forwarded from another source // with an equivalent flags fields (i.e., usually another OTLP span message), the field SHOULD @@ -276,8 +276,8 @@ message Span { // // Bits 8 and 9 represent the 3 states of whether the link is remote. // The states are (unknown, is not remote, is remote). - // To read whether the value is known, use `flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK`. - // To read whether the link is remote, use `flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK`. + // To read whether the value is known, use `(flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0`. + // To read whether the link is remote, use `(flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0`. // // Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. // When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero. From c451441d7b73f702d1647574c730daf7786f188c Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 2 Feb 2024 11:03:39 -0500 Subject: [PATCH 40/41] Add metric.metadata for supporting additional metadata on metrics (#514) * add metric.attributes for supporting additional metadata on metrics --- CHANGELOG.md | 7 +++++++ opentelemetry/proto/metrics/v1/metrics.proto | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d257a8d..11091d6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.1.0...main). +### Added + +* Add metric.metadata for supporting additional metadata on metrics + [#514](https://github.com/open-telemetry/opentelemetry-proto/pull/514) + +### Changed + ## 1.1.0 - 2024-01-10 Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.0.0...v1.1.0). diff --git a/opentelemetry/proto/metrics/v1/metrics.proto b/opentelemetry/proto/metrics/v1/metrics.proto index 3394aee93..19bb7ff8d 100644 --- a/opentelemetry/proto/metrics/v1/metrics.proto +++ b/opentelemetry/proto/metrics/v1/metrics.proto @@ -188,6 +188,15 @@ message Metric { ExponentialHistogram exponential_histogram = 10; Summary summary = 11; } + + // Additional metadata attributes that describe the metric. [Optional]. + // Attributes are non-identifying. + // Consumers SHOULD NOT need to be aware of these attributes. + // These attributes MAY be used to encode information allowing + // for lossless roundtrip translation to / from another data model. + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). + repeated opentelemetry.proto.common.v1.KeyValue metadata = 12; } // Gauge represents the type of a scalar metric that always exports the From 9d139c87b52669a3e2825b835dd828b57a455a55 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 9 Feb 2024 12:27:20 -0500 Subject: [PATCH 41/41] [editorial] Fix path base in Hugo front matter (#530) --- docs/specification.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/specification.md b/docs/specification.md index d017eada4..efa2c3654 100644 --- a/docs/specification.md +++ b/docs/specification.md @@ -9,12 +9,8 @@ spelling: cascade: body_class: otel-docs-spec github_repo: &repo https://github.com/open-telemetry/opentelemetry-proto - github_subdir: docs - path_base_for_github_subdir: content/en/docs/specs/otlp/ + path_base_for_github_subdir: tmp/otlp github_project_repo: *repo -path_base_for_github_subdir: - from: content/en/docs/specs/otlp/_index.md - to: specification.md ---> # OpenTelemetry Protocol Specification