Add readTheDocs (#252)

Co-authored-by: Aaron Abbott <aaronabbott@google.com>
Co-authored-by: alrex <aboten@lightstep.com>
This commit is contained in:
(Eliseo) Nathaniel Ruiz Nowell
2021-01-26 09:06:39 -08:00
committed by GitHub
parent f3a078296c
commit c9075cf1f2
40 changed files with 712 additions and 2 deletions

View File

@ -12,6 +12,50 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Installation
------------
::
pip install opentelemetry-sdk-extension-aws
AWS X-Ray IDs Generator
-----------------------
The **AWS X-Ray IDs Generator** provides a custom IDs Generator to make
traces generated using the OpenTelemetry SDKs `TracerProvider` compatible
with the AWS X-Ray backend service `trace ID format`_.
Usage
-----
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
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())
)
API
---
.. _trace ID format: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-sendingdata.html#xray-api-traceids
"""
import random
import time

View File

@ -12,6 +12,42 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
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
services.
Usage
-----
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())
API
---
.. _trace header: https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader
"""
import logging
import typing