skillfed

opentelemetry-propagator-aws-xray

AWS X-Ray Propagator for OpenTelemetry

opentelemetry-propagator-aws-xray v1.0.2 12.0M downloads/30d#1,351 on PyPI1,086
Permissive license Active released

What it is and what it does

This package provides an OpenTelemetry propagator that handles the AWS X-Ray trace context format, specifically the X-Amzn-Trace-Id header. It allows traces initiated in one AWS service to be correctly linked to downstream services by injecting and extracting tracing context in the format X-Ray expects.

The propagator integrates with OpenTelemetry's global propagation system, either via environment variable (OTEL_PROPAGATORS=xray) or by explicitly setting it in code. It is a thin adapter layer between OpenTelemetry's span context model and AWS X-Ray's header format, with no external dependencies beyond opentelemetry-api itself.

Use it for:

  • Trace requests flowing through multiple AWS Lambda functions, ECS tasks, or EC2 instances using OpenTelemetry.
  • Correlate logs and metrics with X-Ray traces when using AWS CloudWatch and X-Ray together.
  • Export OpenTelemetry spans to AWS X-Ray for visualization and analysis of distributed request flows.
  • Integrate on-premises or third-party services into an AWS X-Ray tracing pipeline via OpenTelemetry.

Worth the install?

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

Injects and extracts AWS X-Ray tracing context into OpenTelemetry spans, enabling trace propagation across AWS services.

Yes. This is a production-stable, actively maintained library with no known vulnerabilities, low install friction, and a permissive license. Install it if you are using OpenTelemetry in an AWS environment and need X-Ray trace propagation. Note the documentation caveat: ensure X-Amzn-Trace-Id headers include Sampled=1 to enable child span sampling.

Install

opentelemetry-propagator-aws-xray on PyPI

pip

pip install opentelemetry-propagator-aws-xray

uv

uv add opentelemetry-propagator-aws-xray

poetry

poetry add opentelemetry-propagator-aws-xray

Installing opentelemetry-propagator-aws-xray

Before you install

Low friction installation with a single runtime dependency (opentelemetry-api). Actively maintained with recent commits and production-stable status.

License in practice

Licensed under Apache Software License (permissive), allowing commercial and private use without restriction.

Quickstart

pip install opentelemetry-propagator-aws-xray

from opentelemetry.propagate import set_global_textmap
from opentelemetry.propagators.aws import AwsXRayPropagator

set_global_textmap(AwsXRayPropagator())

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

Verify before relying

  • Whether X-Amzn-Trace-Id headers are automatically set to Sampled=1 or require manual configuration in all deployment scenarios.
  • Performance impact when propagating traces across high-volume AWS service calls.

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-api
Maintenance actively maintained — 739 days since the last release
Last repo commit
First released
Downloads 11,953,783/month — #1,351 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_propagator_aws_xray-1.0.2-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

aws x-ray tracingopentelemetry propagatordistributed tracing awstrace context propagationx-ray trace headeropentelemetry aws integration
distributed-tracingaws-integrationobservability

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

aws-xray-sdk

Records and sends trace data from Python…

permissive · top 1,000 on PyPI

opentelemetry-propagator-gcp

Propagates trace context in Google Cloud's…

permissive · top 5,000 on PyPI

opentelemetry-sdk-extension-aws

Provides OpenTelemetry SDK components to make…

permissive · top 5,000 on PyPI

opentelemetry-propagator-ot-trace

Provides OpenTelemetry trace context…

permissive · top 5,000 on PyPI

opentelemetry-propagator-jaeger

Provides trace context propagation for the…

permissive · top 5,000 on PyPI

opentelemetry-propagator-b3

Implements the B3 trace context propagation…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-boto

Adds distributed tracing to AWS SDK (Boto)…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-remoulade

Adds distributed tracing instrumentation for…

permissive · top 5,000 on PyPI

azure-core-tracing-opentelemetry

Integrates Azure SDK clients with OpenTelemetry…

unclear · top 5,000 on PyPI

opentelemetry-processor-baggage

Adds baggage context data from OpenTelemetry to…

permissive · top 5,000 on PyPI