opentelemetry-propagator-aws-xray
AWS X-Ray Propagator for OpenTelemetry
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-xrayuv
uv add opentelemetry-propagator-aws-xraypoetry
poetry add opentelemetry-propagator-aws-xrayInstalling 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
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
aws-xray-sdkRecords and sends trace data from Python…
permissive · top 1,000 on PyPI
opentelemetry-propagator-gcpPropagates trace context in Google Cloud's…
permissive · top 5,000 on PyPI
opentelemetry-sdk-extension-awsProvides OpenTelemetry SDK components to make…
permissive · top 5,000 on PyPI
opentelemetry-propagator-ot-traceProvides OpenTelemetry trace context…
permissive · top 5,000 on PyPI
opentelemetry-propagator-jaegerProvides trace context propagation for the…
permissive · top 5,000 on PyPI
opentelemetry-propagator-b3Implements the B3 trace context propagation…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-botoAdds distributed tracing to AWS SDK (Boto)…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-remouladeAdds distributed tracing instrumentation for…
permissive · top 5,000 on PyPI
azure-core-tracing-opentelemetryIntegrates Azure SDK clients with OpenTelemetry…
unclear · top 5,000 on PyPI
opentelemetry-processor-baggageAdds baggage context data from OpenTelemetry to…
permissive · top 5,000 on PyPI