From 43bb201d083db08dc66ac514aca8b42e5a24c00d Mon Sep 17 00:00:00 2001 From: Liudmila Date: Tue, 22 Sep 2020 10:34:35 -0700 Subject: [PATCH 1/5] Allow samplers to modify tracestate, fix #856 --- specification/trace/sdk.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 64303a39269..bd453f9a256 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -99,6 +99,9 @@ It produces an output called `SamplingResult` which contains: * `RECORD_AND_SAMPLE` - `IsRecording() == true` AND `Sampled` flag` MUST be set. * A set of span Attributes that will also be added to the `Span`. The returned object must be immutable (multiple calls may return different immutable objects). +* A `Tracestate` that will be assigned to `Span`. If non-empty `Tracestate` was + passed in `SpanContext`, it MUST be populated on the `SamplingResult` even if + tracestate was not changed by sampler. #### GetDescription From d4b80a6c125bcfe8c6bd8ac533103dd5261a205c Mon Sep 17 00:00:00 2001 From: Liudmila Date: Tue, 22 Sep 2020 10:39:32 -0700 Subject: [PATCH 2/5] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 146dc61fdb8..2c49116b7f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ New: * `exception.escaped` semantic span event attribute was added ([#784](https://github.com/open-telemetry/opentelemetry-specification/pull/784), [#946](https://github.com/open-telemetry/opentelemetry-specification/pull/946)) +- Allow samplers to modify tracestate + ([#856](https://github.com/open-telemetry/opentelemetry-specification/pull/988/)) Updates: From d050af37e78c2de087bd024095e0b2a9c0434161 Mon Sep 17 00:00:00 2001 From: Liudmila Date: Tue, 22 Sep 2020 11:59:15 -0700 Subject: [PATCH 3/5] review: tracestate is associated with Span through the context --- specification/trace/sdk.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index bd453f9a256..b8314427cd4 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -99,9 +99,10 @@ It produces an output called `SamplingResult` which contains: * `RECORD_AND_SAMPLE` - `IsRecording() == true` AND `Sampled` flag` MUST be set. * A set of span Attributes that will also be added to the `Span`. The returned object must be immutable (multiple calls may return different immutable objects). -* A `Tracestate` that will be assigned to `Span`. If non-empty `Tracestate` was - passed in `SpanContext`, it MUST be populated on the `SamplingResult` even if - tracestate was not changed by sampler. +* A `Tracestate` that will be associated with the `Span` through the new + `SpanContext`. If non-empty `Tracestate` was passed in `SpanContext`, + it MUST be populated on the `SamplingResult` even if tracestate was not + changed by sampler. #### GetDescription From 8e5bab694f2e59b72c392be38c52e240544467ff Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 24 Sep 2020 09:27:10 -0700 Subject: [PATCH 4/5] Update sdk.md --- specification/trace/sdk.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index b8314427cd4..92ff16e7b05 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -100,9 +100,10 @@ It produces an output called `SamplingResult` which contains: * A set of span Attributes that will also be added to the `Span`. The returned object must be immutable (multiple calls may return different immutable objects). * A `Tracestate` that will be associated with the `Span` through the new - `SpanContext`. If non-empty `Tracestate` was passed in `SpanContext`, - it MUST be populated on the `SamplingResult` even if tracestate was not - changed by sampler. + `SpanContext`. + Note: If the sampler returns an empty `Tracestate` here, the `Tracestate` will be cleared, + so samplers should normally return the passed-in `Tracestate` if they do not intend + to change it. #### GetDescription From 652a1c202320bfcbb65705016833afe7ba50fe06 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 24 Sep 2020 09:30:32 -0700 Subject: [PATCH 5/5] Update sdk.md --- specification/trace/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 95028342f81..1fa8b983fac 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -100,7 +100,7 @@ It produces an output called `SamplingResult` which contains: * A set of span Attributes that will also be added to the `Span`. The returned object must be immutable (multiple calls may return different immutable objects). * A `Tracestate` that will be associated with the `Span` through the new - `SpanContext`. + `SpanContext`. Note: If the sampler returns an empty `Tracestate` here, the `Tracestate` will be cleared, so samplers should normally return the passed-in `Tracestate` if they do not intend to change it.