Skip to content

Commit ca2acc5

Browse files
authored
Update python docs to reference new propagator pkg (#188)
* Update python docs to reference new propagator pkg * Add link to docs on X-Ray tracing header
1 parent 792d4f2 commit ca2acc5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/docs/getting-started/python-sdk/trace-auto-instr.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SubSectionSeparator from "components/MdxSubSectionSeparator/subsectionSep
1111

1212
## Introduction
1313

14-
OpenTelemetry Python supports automatic instrumentation. It automatically produces spans with telemetry data describing the values used by the python frameworks in your application without adding a single line of code. This telemetry data can then be exported to a backend like AWS X-Ray using the ADOT Python `opentelemetry-sdk-extension-aws` package.
14+
OpenTelemetry Python supports automatic instrumentation. It automatically produces spans with telemetry data describing the values used by the python frameworks in your application without adding a single line of code. This telemetry data can then be exported to a backend like AWS X-Ray using the ADOT Python `opentelemetry-sdk-extension-aws` package. We also strongly recommend using the `opentelemetry-propagator-aws-xray` package to support propagating the trace context across AWS services. This propagator handles the extraction and injecting of the [AWS X-Ray Tracing header](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader) for requests from or to remote services.
1515

1616
In this guide, we walk through the steps needed to trace an application with auto-instrumentation.
1717

@@ -32,10 +32,13 @@ The easiest way to download the packages needed for auto-instrumentation is usin
3232
```bash
3333
# Install required packages for instrumentation and to support tracing with AWS X-Ray
3434
$ pip install opentelemetry-distro[otlp]>=0.24b0 \
35-
opentelemetry-sdk-extension-aws~=1.0
35+
opentelemetry-sdk-extension-aws~=2.0 \
36+
opentelemetry-propagator-aws-xray~=1.0
3637
```
3738

38-
Installing the `opentelemetry-sdk-extension-aws` package automatically installs the `opentelemetry-api`, `opentelemetry-sdk`, and `opentelemetry-instrumentation` packages as dependencies.
39+
The `opentelemetry-distro` package provides methods which configure the OpenTelemetry SDK with some basic defaults. These methods are used by Auto Instrumentation. Because you added the `[otlp]` "extra" command, the `opentelemetry-exporter-otlp` package (used to send traces to the ADOT Collector) is also automatically installed.
40+
41+
Installing the `opentelemetry-sdk-extension-aws` package automatically installs the `opentelemetry-api`, `opentelemetry-sdk`, and `opentelemetry-instrumentation` packages as dependencies. You also need the `opentelemetry-propagator-aws-xray` package to obtain the `AwsXRayPropagator` class used to propagate the trace context across AWS services.
3942

4043
`opentelemetry-instrumentation` provides commands to detect, install, and initialize all instrumentation packages supported for your application’s dependencies. Notably, it installs the `opentelemetry-bootstrap` and `opentelemetry-instrument` executables on your system.
4144

src/docs/getting-started/python-sdk/trace-manual-instr.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SubSectionSeparator from "components/MdxSubSectionSeparator/subsectionSep
1111

1212
## Introduction
1313

14-
With OpenTelemetry Python manual instrumentation, you configure the OpenTelemetry SDK within your application's code. It automatically produces spans with telemetry data describing the values used by the Python frameworks in your application with only a few lines of code. This telemetry data can then be exported to a backend like AWS X-Ray using the ADOT Python `opentelemetry-sdk-extension-aws` package.
14+
With OpenTelemetry Python manual instrumentation, you configure the OpenTelemetry SDK within your application's code. It automatically produces spans with telemetry data describing the values used by the Python frameworks in your application with only a few lines of code. This telemetry data can then be exported to a backend like AWS X-Ray using the ADOT Python `opentelemetry-sdk-extension-aws` package. We also strongly recommend using the `opentelemetry-propagator-aws-xray` package to support propagating the trace context across AWS services. This propagator handles the extraction and injecting of the [AWS X-Ray Tracing header](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader) for requests from or to remote services.
1515

1616
In this guide, we walk through the steps needed to trace an application with auto instrumentation.
1717

@@ -30,7 +30,8 @@ Note: You’ll also need to have the [ADOT Collector](https://aws-otel.github.io
3030
Install the following packages and its dependencies from OpenTelemetry Python using pip.
3131

3232
```bash
33-
$ pip install opentelemetry-sdk-extension-aws~=1.0 \
33+
$ pip install opentelemetry-sdk-extension-aws~=2.0 \
34+
opentelemetry-propagator-aws-xray~=1.0 \
3435
opentelemetry-exporter-otlp~=1.5 \
3536
```
3637

@@ -93,13 +94,13 @@ Instead of setting the `IdGenerator` of the `TracerProvider` in code, you can al
9394
OTEL_PYTHON_ID_GENERATOR=xray
9495
```
9596

96-
To allow the span context to propagate downstream when the application makes calls to external services, configure the global propagator to use the AWS X-Ray Propagator. You can set the global propagator in code, and should configure the propagator as soon as possible in your application's code.
97+
To allow the span context to propagate downstream when the application makes calls to external services, configure the global propagator to use the AWS X-Ray Propagator, which is found in the `opentelemetry-propagator-aws-xray` package. You can set the global propagator in code, and should configure the propagator as soon as possible in your application's code.
9798

9899

99100
```python lineNumbers=true
100101
from opentelemetry import propagate
101-
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import AwsXRayFormat
102-
propagate.set_global_textmap(AwsXRayFormat())
102+
from opentelemetry.propagators.aws import AwsXRayPropagator
103+
propagate.set_global_textmap(AwsXRayPropagator())
103104
```
104105

105106
Alternatively, set the `OTEL_PROPAGATORS` environment variable to achieve the same result.

0 commit comments

Comments
 (0)