aws-xray-sdk
The AWS X-Ray SDK for Python (the SDK) enables Python developers to record and emit information from within their applications to the AWS X-Ray service.
Decision gist · record as of 2026-08-14
Yes, if you are already using AWS X-Ray and need Python instrumentation—the SDK is stable, dependency-free, and well-maintained. However, do not start new projects with it: AWS is transitioning to OpenTelemetry as the standard. For existing deployments, plan a migration to ADOT or OpenTelemetry before February 25, 2027, when support ends.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7 or later.
- X-Ray daemon must be running and accessible at the configured address (default 127.0.0.1:3000).
- Low install friction with no runtime dependencies.
License · maintenance · safety
Apache License 2.0 (permissive) — Licensed under Apache License 2.0 (permissive). No restrictions on commercial use, modification, or distribution, though you must include a copy of the license and state significant changes.
last release 2025-10-29 (289 days) · last repo commit 2026-08-05 · 338 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 23,274,554 downloads/mo, #953 on PyPI
Alternatives
Verify before relying
pip install aws-xray-sdk
from aws_xray_sdk.core import xray_recorder
xray_recorder.configure(sampling=False, daemon_address='127.0.0.1:3000')
with xray_recorder.in_segment('my_segment') as segment:
segment.put_metadata('key', {'data': 'value'}, 'namespace')- Whether OpenTelemetry instrumentation is a suitable replacement for your specific tracing use case before the SDK reaches end-of-support.
- Compatibility with custom AWS service integrations beyond the built-in EC2, ECS, and Elastic Beanstalk plugins.
What it is and what it does
The AWS X-Ray SDK for Python is an instrumentation library that captures trace data from your application and sends it to the AWS X-Ray service for distributed tracing and performance analysis. It works by recording segments (top-level traces) and subsegments (nested traces) around your application logic, allowing you to visualize request flows across services and identify performance bottlenecks. You configure it once with your X-Ray daemon address and sampling preferences, then use context managers or explicit begin/end calls to wrap code blocks you want to trace. The SDK also provides decorators for automatic tracing of function calls and integrates with AWS services like boto3 for transparent tracing of downstream calls.
The package has no external runtime dependencies, making installation straightforward. It supports Python 3.7 through 3.11 and is actively maintained, though it is entering a maintenance-only phase starting February 25, 2026. After that date, only critical security fixes will be released; the SDK will reach full end-of-support on February 25, 2027. AWS recommends migrating to OpenTelemetry instrumentation for new projects, but the SDK remains functional and supported for existing deployments during the transition window.
Use it for
- Trace requests across microservices to visualize end-to-end request flows and identify latency bottlenecks.
- Record metadata and annotations on trace segments to correlate application events with performance metrics.
- Instrument Lambda functions to track SQS message processing with per-message sampling decisions.
- Wrap boto3 calls with unsampled subsegments to reduce trace volume while maintaining visibility into critical operations.
- Capture function execution timing and errors automatically using the @xray_recorder.capture decorator.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already using AWS X-Ray and need Python instrumentation—the SDK is stable, dependency-free, and well-maintained.
However, do not start new projects with it: AWS is transitioning to OpenTelemetry as the standard. For existing deployments, plan a migration to ADOT or OpenTelemetry before February 25, 2027, when support ends.
Install
aws-xray-sdk on PyPI
Before you install
Low install friction with no runtime dependencies. Repository is active with recent commits. Note: the package enters maintenance mode on February 25, 2026, and reaches end-of-support on February 25, 2027—only critical bug fixes and security updates will be provided after maintenance begins.
Requires Python 3.7 or later. X-Ray daemon must be running and accessible at the configured address (default 127.0.0.1:3000).
License in practice
Licensed under Apache License 2.0 (permissive). No restrictions on commercial use, modification, or distribution, though you must include a copy of the license and state significant changes.
Quickstart
pip install aws-xray-sdk
from aws_xray_sdk.core import xray_recorder
xray_recorder.configure(sampling=False, daemon_address='127.0.0.1:3000')
with xray_recorder.in_segment('my_segment') as segment:
segment.put_metadata('key', {'data': 'value'}, 'namespace')
Verify before relying
- Whether OpenTelemetry instrumentation is a suitable replacement for your specific tracing use case before the SDK reaches end-of-support.
- Compatibility with custom AWS service integrations beyond the built-in EC2, ECS, and Elastic Beanstalk plugins.
Package facts
| License | Apache License 2.0 permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 289 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 23,274,554 / month, #953 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: aws_xray_sdk-2.15.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “trace recording and emission”
- aws-xray-sdkRecords and sends trace data from Python applications to AWS X-Ray…
- pyvcdPyVCD writes and reads Value Change Dump (VCD) files as specified in…
- opentelemetry-instrumentation-voyageaiAutomatically captures and traces Voyage AI API calls (embeddings and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also opentelemetry-propagator-aws-xray · opentelemetry-sdk-extension-aws · types-aws-xray-sdk · opentelemetry-instrumentation-boto · opentelemetry-instrumentation-aws-lambda · opentelemetry-instrumentation-botocore · opentelemetry-instrumentation-lancedb · opentelemetry-instrumentation-boto3sqs · opentelemetry-instrumentation-qdrant · azure-core-tracing-opentelemetry