From 55ca4822e2c9f913f2b2c934eb2d9edd119864b3 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 11 Mar 2021 11:25:55 -0800 Subject: [PATCH 1/4] Clarify the TraceIdRatioBased description format Samplers need to return a static string as a description. The string the TraceIdRatioBased sampler returns needs to be based on the sampling ratio that it is configured for. The current specification could be misinterpreted as requiring a static string that was not based on the samplers sampling ratio be used. This corrects that discrepancy. --- specification/trace/sdk.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index b4f6b8e06c6..b7e3351cfb5 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -252,7 +252,13 @@ The default sampler is `ParentBased(root=AlwaysOn)`. * The `TraceIdRatioBased` MUST ignore the parent `SampledFlag`. To respect the parent `SampledFlag`, the `TraceIdRatioBased` should be used as a delegate of the `ParentBased` sampler specified below. -* Description MUST be `TraceIdRatioBased{0.000100}`. +* Description MUST return a string of the form `"TraceIdRatioBased{RATIO}"` + with `RATIO` replaced with the Sampler instances' trace sampling ratio + represented as a decimal number. The precision of the number SHOULD follow + implementation language standards and SHOULD be high enough to identify when + Samplers have different ratios. For example, if a TraceIdRatioBased Sampler + had a sampling ratio of 1 to every 10,000 spans it could return + `"TraceIdRatioBased{0.000100}"` as its description. TODO: Add details about how the `TraceIdRatioBased` is implemented as a function of the `TraceID`. [#1413](https://github.com/open-telemetry/opentelemetry-specification/issues/1413) From 6901c2b858414b6bc3837c67872964535e5f203d Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 12 Mar 2021 07:44:50 -0800 Subject: [PATCH 2/4] Update specification/trace/sdk.md Co-authored-by: Armin Ruech --- 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 b7e3351cfb5..c4075e2e1db 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -253,7 +253,7 @@ The default sampler is `ParentBased(root=AlwaysOn)`. parent `SampledFlag`, the `TraceIdRatioBased` should be used as a delegate of the `ParentBased` sampler specified below. * Description MUST return a string of the form `"TraceIdRatioBased{RATIO}"` - with `RATIO` replaced with the Sampler instances' trace sampling ratio + with `RATIO` replaced with the Sampler instance's trace sampling ratio represented as a decimal number. The precision of the number SHOULD follow implementation language standards and SHOULD be high enough to identify when Samplers have different ratios. For example, if a TraceIdRatioBased Sampler From d80362767e7034c73441ade9ea91487f584e982d Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 12 Mar 2021 07:49:35 -0800 Subject: [PATCH 3/4] Add changes to CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a359c2e6b16..b22fca0a75a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ release. ### Traces +- Clarify the description for the `TraceIdRatioBased` sampler needs to include the sampler's sampling ratio. ([#1536](https://github.com/open-telemetry/opentelemetry-specification/pull/1536)) + ### Metrics ### Logs From 34e1f4755e7fc5c29dd1300effd091fa2a9e860c Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Mon, 15 Mar 2021 15:00:09 +0100 Subject: [PATCH 4/4] Update specification/trace/sdk.md Co-authored-by: Nikita Salnikov-Tarnovski --- 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 c4075e2e1db..a99404fbecd 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -257,7 +257,7 @@ the `ParentBased` sampler specified below. represented as a decimal number. The precision of the number SHOULD follow implementation language standards and SHOULD be high enough to identify when Samplers have different ratios. For example, if a TraceIdRatioBased Sampler - had a sampling ratio of 1 to every 10,000 spans it could return + had a sampling ratio of 1 to every 10,000 spans it COULD return `"TraceIdRatioBased{0.000100}"` as its description. TODO: Add details about how the `TraceIdRatioBased` is implemented as a function