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 = aws_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.19b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ee128e9344262d3200fb20d4f1bf0a730d9e7844b33da3f602e08c2dbc3e460 |
|
MD5 | e18e2177d5a91ddf03484d1f54c6947f |
|
BLAKE2b-256 | ab2e0c1f20417664422c74caa62bb2121b9b81ebb9e6a1d84c78fc11e2c56b49 |
Hashes for opentelemetry_sdk_extension_aws-0.19b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f10d61e7dcb7700784fe35a0344a4abf417dd9c964bdbcedf0ea5946d1035d2 |
|
MD5 | 8ea9e2dd973a8d7a1bd03361bffc0bc4 |
|
BLAKE2b-256 | 9f24871ca1560e071d1c00ad9fa37a3add2f736de483f03ca7f2d5e1464fd7f1 |