Skip to main content

AWS SDK extension for OpenTelemetry

Project description


This library provides components necessary to configure the OpenTelemetry SDK for tracing with AWS X-Ray.


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 import AwsXRayIdGenerator
from opentelemetry.sdk.trace import TracerProvider


Usage (AWS Resource Detectors)

Use the provided Resource Detectors to automatically populate attributes under the resource namespace of each generated span.

For example, if tracing with OpenTelemetry on an AWS EC2 instance, you can automatically populate resource attributes by creating a TraceProvider using the AwsEc2ResourceDetector:

import opentelemetry.trace as trace
from opentelemetry.sdk.trace import TracerProvider
from import (
from opentelemetry.sdk.resources import get_aggregated_resources


Refer to each detectors’ docstring to determine any possible requirements for that detector.


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentelemetry-sdk-extension-aws-2.0.1.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page