skillfed

opentelemetry-sdk-extension-aws

AWS SDK extension for OpenTelemetry

opentelemetry-sdk-extension-aws v2.1.0 6.2M downloads/30d#1,956 on PyPI1,086
Permissive license Active released

What it is and what it does

This package extends OpenTelemetry's SDK with AWS-specific components that bridge the gap between OpenTelemetry's distributed tracing model and AWS X-Ray's backend service. It provides an AwsXRayIdGenerator that formats span IDs and trace IDs in the format X-Ray expects, ensuring compatibility when exporting traces to X-Ray. It also includes resource detectors that automatically populate span resource attributes with AWS environment metadata—such as EC2 instance information—without requiring manual configuration.

The package is designed for developers instrumenting applications running on AWS infrastructure who want to use OpenTelemetry for observability while sending traces to X-Ray. It handles the translation layer between OpenTelemetry's semantic conventions and X-Ray's requirements, reducing boilerplate and configuration errors.

Use it for:

  • Configure OpenTelemetry tracing on an EC2 instance to automatically detect and attach instance metadata to spans sent to AWS X-Ray.
  • Instrument a microservice deployed on AWS with OpenTelemetry while ensuring trace IDs remain compatible with X-Ray's trace format.
  • Populate resource attributes (region, instance ID, availability zone) automatically when creating a TracerProvider for AWS workloads.
  • Integrate OpenTelemetry into an existing AWS X-Ray observability pipeline without manual ID translation or resource mapping.
  • Build a multi-service tracing setup on AWS where OpenTelemetry agents export traces to X-Ray with proper AWS resource context.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides OpenTelemetry SDK components to make distributed traces compatible with AWS X-Ray, including a custom ID generator and resource detectors for AWS services.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and is essential if you are using OpenTelemetry with AWS X-Ray. The permissive license and broad Python version support (3.8–3.12) make adoption straightforward. Install it if you need X-Ray compatibility; skip it if you are not using X-Ray or are not instrumenting AWS workloads.

Install

opentelemetry-sdk-extension-aws on PyPI

pip

pip install opentelemetry-sdk-extension-aws

uv

uv add opentelemetry-sdk-extension-aws

poetry

poetry add opentelemetry-sdk-extension-aws

Installing opentelemetry-sdk-extension-aws

Before you install

Low install friction with a single runtime dependency on opentelemetry-sdk. Actively maintained as of 2026-08-14 with no known vulnerabilities.

License in practice

Licensed under permissive terms (Apache Software License), imposing no restrictions on use or redistribution in proprietary or open-source projects.

Quickstart

pip install opentelemetry-sdk-extension-aws

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())
)

Requires opentelemetry-sdk to be installed separately; Python 3.8 or later.

Verify before relying

  • Whether resource detectors (e.g., AwsEc2ResourceDetector) require AWS credentials or IAM permissions to function.
  • Performance overhead of resource detection on non-AWS environments or when detectors fail to retrieve metadata.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — opentelemetry-sdk
Maintenance actively maintained — 598 days since the last release
Last repo commit
First released
Downloads 6,219,298/month — #1,956 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_sdk_extension_aws-2.1.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

opentelemetry aws x-ray tracingotel sdk aws extensionx-ray trace id generatoraws resource detector otelopentelemetry aws integrationdistributed tracing aws x-rayotel aws ec2 resource detection
observabilityaws-integrationdistributed-tracing

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-propagator-aws-xray

Injects and extracts AWS X-Ray tracing context…

permissive · top 5,000 on PyPI

opentelemetry-resource-detector-containerid

Detects and registers container runtime…

permissive · top 15,000 on PyPI

aws-xray-sdk

Records and sends trace data from Python…

permissive · top 1,000 on PyPI

azure-core-tracing-opentelemetry

Integrates Azure SDK clients with OpenTelemetry…

unclear · top 5,000 on PyPI

opentelemetry-instrumentation-boto

Adds distributed tracing to AWS SDK (Boto)…

permissive · top 5,000 on PyPI

opentelemetry-resource-detector-azure

Provides OpenTelemetry resource detectors that…

permissive · top 5,000 on PyPI

aiobotocore-otel

Adds distributed tracing to aiobotocore AWS API…

permissive · top 15,000 on PyPI

opentelemetry-resourcedetector-docker

Extracts Docker container metadata and…

permissive · top 5,000 on PyPI

opentelemetry-resourcedetector-kubernetes

Detects and populates OpenTelemetry Resource…

permissive · top 5,000 on PyPI

opentelemetry-exporter-gcp-trace

Exports OpenTelemetry traces to Google Cloud…

permissive · top 5,000 on PyPI