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.22b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e37a40e9911c9c81c3ec650bffacf0efe9dc0f6fd2448c4086855f57bd1988a1 |
|
MD5 | 01cbe7e19da3e76be5af793773ae54b7 |
|
BLAKE2b-256 | 5e7c5b77948832ef7e81f766ee2db31f22c02749664f34298af4a78b0ea0df61 |
Hashes for opentelemetry_sdk_extension_aws-0.22b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a1322975b7b19cd578ebad614cc90c4b56b799c23dcb9e51865da0876f3c09 |
|
MD5 | 4acd4ac544346756989aca5060b8ada9 |
|
BLAKE2b-256 | 0e4778ada997b2e52776f956b648fb55b73c9c2b8abec376646ac1a001ff0380 |