From 9df5bf2579ad3b7eded7cab3c5255314d1d7adf7 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Thu, 7 Mar 2024 14:59:36 +0100 Subject: [PATCH 1/6] Links with invalid SpanContext are recorded by default. As Links with invalid SpanContext may contain attributes describing the operation (specially useful and occurrent for messaging systems), we still want to collect them, also allowing the user to drop them via a SDK configuration option. --- specification/trace/api.md | 4 ++-- specification/trace/sdk.md | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/specification/trace/api.md b/specification/trace/api.md index b28dc26e0f6..88ea5046055 100644 --- a/specification/trace/api.md +++ b/specification/trace/api.md @@ -807,8 +807,8 @@ The API MUST provide: arguments. This MAY be called `AddLink`. This API takes the `SpanContext` of the `Span` to link to and optional `Attributes`, either as individual parameters or as an immutable object encapsulating them, whichever is most - appropriate for the language. Implementations MAY ignore links with an - [invalid](#isvalid) `SpanContext`. + appropriate for the language. Implementations SHOULD record links with an + [invalid](#isvalid) `SpanContext` as well. The Span interface MAY provide: diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 58d893e8907..ef9aef0a90b 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -84,6 +84,10 @@ Note: Implementation-wise, this could mean that `Tracer` instances have a reference to their `TracerProvider` and access configuration only via this reference. +A boolean parameter indicating whether `Links` with invalid `SpanContext` +are recorded or not SHOULD be exposed as part of the configuration, +with true as its default value. + ### Shutdown This method provides a way for provider to do any cleanup required. From 6d706c274e9161b123c8a789f5e7495cb40a8d89 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Thu, 14 Mar 2024 15:46:05 +0100 Subject: [PATCH 2/6] Apply feedback. --- specification/trace/api.md | 5 +++-- specification/trace/sdk.md | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/specification/trace/api.md b/specification/trace/api.md index 88ea5046055..6fd819c351b 100644 --- a/specification/trace/api.md +++ b/specification/trace/api.md @@ -807,8 +807,9 @@ The API MUST provide: arguments. This MAY be called `AddLink`. This API takes the `SpanContext` of the `Span` to link to and optional `Attributes`, either as individual parameters or as an immutable object encapsulating them, whichever is most - appropriate for the language. Implementations SHOULD record links with an - [invalid](#isvalid) `SpanContext` as well. + appropriate for the language. Implementations SHOULD record links with + [invalid](#isvalid) `SpanContext` as long as either the attribute set + or `TraceState` is non-empty. The Span interface MAY provide: diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index ef9aef0a90b..58d893e8907 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -84,10 +84,6 @@ Note: Implementation-wise, this could mean that `Tracer` instances have a reference to their `TracerProvider` and access configuration only via this reference. -A boolean parameter indicating whether `Links` with invalid `SpanContext` -are recorded or not SHOULD be exposed as part of the configuration, -with true as its default value. - ### Shutdown This method provides a way for provider to do any cleanup required. From dcaec279477b27a0789a3835827f09aa6cf42ae6 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Thu, 14 Mar 2024 15:48:23 +0100 Subject: [PATCH 3/6] Update CHANGELOG. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5ecc59f7d..1f8d4b75d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ release. ### Traces +- Links with invalid SpanContext are recorded by default. + ([#3928](https://github.com/open-telemetry/opentelemetry-specification/pull/3928)) + ### Metrics ### Logs From 1b85580e77b5a31fbe402c65f9ba53d4470634e0 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Thu, 14 Mar 2024 17:27:52 +0100 Subject: [PATCH 4/6] Update CHANGELOG.md Co-authored-by: Trask Stalnaker --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f8d4b75d95..d3031e2cc1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ release. ### Traces -- Links with invalid SpanContext are recorded by default. +- Links with invalid SpanContext are recorded. ([#3928](https://github.com/open-telemetry/opentelemetry-specification/pull/3928)) ### Metrics From 2138d66f0d259f906a6ee43b729b0cfe317b4087 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Wed, 17 Apr 2024 17:22:53 +0200 Subject: [PATCH 5/6] Minor clarification. --- specification/trace/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/trace/api.md b/specification/trace/api.md index c5645183cab..b259acdd938 100644 --- a/specification/trace/api.md +++ b/specification/trace/api.md @@ -805,8 +805,8 @@ The API MUST provide: arguments. This MAY be called `AddLink`. This API takes the `SpanContext` of the `Span` to link to and optional `Attributes`, either as individual parameters or as an immutable object encapsulating them, whichever is most - appropriate for the language. Implementations SHOULD record links with - [invalid](#isvalid) `SpanContext` as long as either the attribute set + appropriate for the language. Implementations SHOULD record links containing + `SpanContext` with empty `TraceId` or `SpanId` as long as either the attribute set or `TraceState` is non-empty. The Span interface MAY provide: From d2c76dce89e80984c3bdfbbb01e0852b62a66715 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Wed, 1 May 2024 13:57:10 +0200 Subject: [PATCH 6/6] Update specification/trace/api.md Co-authored-by: Trask Stalnaker --- specification/trace/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/trace/api.md b/specification/trace/api.md index b259acdd938..88d4b1cd168 100644 --- a/specification/trace/api.md +++ b/specification/trace/api.md @@ -806,7 +806,7 @@ The API MUST provide: the `Span` to link to and optional `Attributes`, either as individual parameters or as an immutable object encapsulating them, whichever is most appropriate for the language. Implementations SHOULD record links containing - `SpanContext` with empty `TraceId` or `SpanId` as long as either the attribute set + `SpanContext` with empty `TraceId` or `SpanId` (all zeros) as long as either the attribute set or `TraceState` is non-empty. The Span interface MAY provide: