From 97e9f2f9ef6c775108ab30946a8668f64f37a4d9 Mon Sep 17 00:00:00 2001 From: "(Eliseo) Nathaniel Ruiz Nowell" Date: Wed, 8 Sep 2021 11:43:20 -0700 Subject: [PATCH] Update Doc for aws propagator default sampling behavior (#656) --- .../opentelemetry-sdk-extension-aws/README.rst | 5 +++++ .../extension/aws/trace/propagation/aws_xray_format.py | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/README.rst b/sdk-extension/opentelemetry-sdk-extension-aws/README.rst index c760f5e22..fe17bbcdc 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/README.rst +++ b/sdk-extension/opentelemetry-sdk-extension-aws/README.rst @@ -46,6 +46,11 @@ Next, use the provided `AwsXRayIdGenerator` to initialize the `TracerProvider`. Usage (AWS X-Ray Propagator) ---------------------------- +**NOTE**: Because the parent context extracted from the `X-Amzn-Trace-Id` header +assumes the context is _not_ sampled by default, users should make sure to add +`Sampled=1` to their `X-Amzn-Trace-Id` headers so that the child spans are +sampled. + Use the provided AWS X-Ray Propagator to inject the necessary context into traces sent to external systems. diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/propagation/aws_xray_format.py b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/propagation/aws_xray_format.py index 2bc145b79..9ec12fe3e 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/propagation/aws_xray_format.py +++ b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/propagation/aws_xray_format.py @@ -18,9 +18,17 @@ AWS X-Ray Propagator The **AWS X-Ray Propagator** provides a propagator that when used, adds a `trace header`_ to outgoing traces that is compatible with the AWS X-Ray backend service. -This allows the trace context to be propagated when a trace span multiple AWS +This allows the trace context to be propagated when a trace spans multiple AWS services. +The same propagator setup is used to extract a context sent by external systems +so that child span have the correct parent context. + +**NOTE**: Because the parent context parsed from the ``X-Amzn-Trace-Id`` header +assumes the context is _not_ sampled by default, users should make sure to add +``Sampled=1`` to their ``X-Amzn-Trace-Id`` headers so that the child spans are +sampled. + Usage -----