You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/getting-started/python-sdk/trace-auto-instr.mdx
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ import SubSectionSeparator from "components/MdxSubSectionSeparator/subsectionSep
11
11
12
12
## Introduction
13
13
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.
15
15
16
16
In this guide, we walk through the steps needed to trace an application with auto-instrumentation.
17
17
@@ -32,10 +32,13 @@ The easiest way to download the packages needed for auto-instrumentation is usin
32
32
```bash
33
33
# Install required packages for instrumentation and to support tracing with AWS X-Ray
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.
39
42
40
43
`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.
Copy file name to clipboardExpand all lines: src/docs/getting-started/python-sdk/trace-manual-instr.mdx
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ import SubSectionSeparator from "components/MdxSubSectionSeparator/subsectionSep
11
11
12
12
## Introduction
13
13
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.
15
15
16
16
In this guide, we walk through the steps needed to trace an application with auto instrumentation.
17
17
@@ -30,7 +30,8 @@ Note: You’ll also need to have the [ADOT Collector](https://aws-otel.github.io
30
30
Install the following packages and its dependencies from OpenTelemetry Python using pip.
@@ -93,13 +94,13 @@ Instead of setting the `IdGenerator` of the `TracerProvider` in code, you can al
93
94
OTEL_PYTHON_ID_GENERATOR=xray
94
95
```
95
96
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.
97
98
98
99
99
100
```python lineNumbers=true
100
101
from opentelemetry import propagate
101
-
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_formatimportAwsXRayFormat
102
-
propagate.set_global_textmap(AwsXRayFormat())
102
+
from opentelemetry.propagators.aws importAwsXRayPropagator
103
+
propagate.set_global_textmap(AwsXRayPropagator())
103
104
```
104
105
105
106
Alternatively, set the `OTEL_PROPAGATORS` environment variable to achieve the same result.
0 commit comments