AWS SDK extension for OpenTelemetry
Project description
This library provides components necessary to configure the OpenTelemetry SDK for tracing with AWS X-Ray.
Installation
pip install opentelemetry-sdk-extension-aws
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
Next, use the provided AwsXRayIdGenerator to initialize the TracerProvider.
import opentelemetry.trace as trace
from opentelemetry.sdk.extension.aws.trace import AwsXRayIdGenerator
from opentelemetry.sdk.trace import TracerProvider
trace.set_tracer_provider(
TracerProvider(id_generator=AwsXRayIdGenerator())
)
Usage (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 = xray
Or by setting this propagator in your instrumented application:
from opentelemetry.propagate import set_global_textmap
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import AwsXRayFormat
set_global_textmap(AwsXRayFormat())
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for opentelemetry-sdk-extension-aws-0.23b2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 893428ba2029edd4b57d8f5261100eb6e89b990f4dc8dfad3327c4f99ed5fe8a |
|
MD5 | 9093dfb476a8641199c3a17528ef3a4e |
|
BLAKE2b-256 | dc3ac0f706922f705ef5bfac984eff94fc8fae73540385ffcb5f11560c359b29 |
Hashes for opentelemetry_sdk_extension_aws-0.23b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b8ae373e0d6d0e906b39c52b89e4bbdd36b49bf13815e865b1599b3f1e1cfe3 |
|
MD5 | 8efa9fd6704afbd594e70e75682ece99 |
|
BLAKE2b-256 | 2dc7f88e12a488e05a072d668997ea1c304b8c5049335e9f3a6ce0665d3a2b2f |