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.16b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfdf48e66186b8374623a9d13d0fc6287f5415f51f237b6ca107d28f19abf108 |
|
MD5 | e9c35adccc034089c946ce0019a053c0 |
|
BLAKE2b-256 | 85b72d833541e81bf50835f22ada27fc219bf5dce0f2463b716b3ca54e203db5 |
Hashes for opentelemetry_sdk_extension_aws-0.16b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc923fa885a667e3f976ad37b3ea71fb2474d00482ada35a8584ebc19c219f8e |
|
MD5 | d9319cf72946988d88269be204ceabbe |
|
BLAKE2b-256 | 7098107b5f15e4b78d813457cc2c14af1a1c3a09d4652d61066744b41103422a |