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 AwsXRayIdsGenerator to initialize the TracerProvider.
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())
)
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 import propagators
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import AwsXRayFormat
propagators.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.16b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c65548ce1934c3bcffff830f9062e315d4e85c897a0bda8c7016d26bc5a681 |
|
MD5 | 50a6f87c87b3be8df306e3e7e587605b |
|
BLAKE2b-256 | ce75fdc6bf992ee4e54f98d193e911deac5e8929f905bb9c982cedcd9bc5c60d |
Hashes for opentelemetry_sdk_extension_aws-0.16b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11549f8defa0897082e64f8bd42faa10e369205a8a4d642298be174c091f321f |
|
MD5 | 5783fb732f535b82cda5900b9d128014 |
|
BLAKE2b-256 | 8e0cbc16a53dedd8357ae98891e15c13e1a5e0bc19c1b45df30a676693e3f21c |