Skip to content

Commit

Permalink
Import missing components for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielRN committed Nov 20, 2020
1 parent f0f6a19 commit bd80ab0
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions sdk-extension/opentelemetry-sdk-extension-aws/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ Usage (AWS X-Ray IDs Generator)
Configure the OTel SDK TracerProvider with the provided custom IDs Generator to
make spans compatible with the AWS X-Ray backend tracing service.

Install the OpenTelemetry SDK package.

::

pip install opentelemetry-sdk-extension-aws

Next, use the provided `AwsXRayIdsGenerator` to initialize the `TracerProvider`.

.. code-block:: python
import opentelemetry.trace as trace
from opentelemetry.sdk.extension.aws.trace import AwsXRayIdsGenerator
from opentelemetry.sdk.trace import TracerProvider
trace.set_tracer_provider(
TracerProvider(ids_generator=AwsXRayIdsGenerator())
Expand All @@ -36,14 +46,25 @@ make spans compatible with the AWS X-Ray backend tracing service.
Usage (AWS X-Ray Propagator)
----------------------------

Set this environment variable to have the OTel SDK use the provided AWS X-Ray
Propagator:
Use the provided AWS X-Ray Propagator to inject the necessary context into
traces sent to external systems.

This can be done by either setting this environment variable:

::

export OTEL_PROPAGATORS = aws_xray


Or by setting this propagator in your instrumented application:

.. code-block:: python
from opentelemetry import propagators
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import AwsXRayFormat
propagators.set_global_textmap(AwsXRayFormat())
References
----------

Expand Down

0 comments on commit bd80ab0

Please sign in to comment.