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.21b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05926613e659254bf5f7578baa0e131de4f7c2198a3b56021da9098c6dfa0b56 |
|
MD5 | cb4fe8365e39b31bad131d2d038c6a6c |
|
BLAKE2b-256 | d3512284fd22ef44a4de77bb0cffdfce3010bfc2484344117fc91cb391f032a7 |
Hashes for opentelemetry_sdk_extension_aws-0.21b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f1065debb3fc9e194559ee86d24ef8768407e7ae1c050c5766d80d32b64fcf |
|
MD5 | 79f20f79803e2e843e21d8493a569259 |
|
BLAKE2b-256 | 8ebde4f6ba0f67bb101f665d012588f7578a8b4546358eb3d86de3ee904a1de0 |