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.
Description
 [](https://codecov.io/gh/aws/aws-xray-sdk-python) # AWS X-Ray SDK for Python ## :mega: Upcoming Maintenance Mode on February 25, 2026 [The AWS X-Ray SDKs will enter maintenance mode on **`February 25, 2026`**][xray-sdk-daemon-timeline]. During maintenance mode, the X-Ray SDKs and Daemon will only receive critical bug fixes and security updates, and will not be updated to support new features. We recommend that you migrate to [AWS Distro for OpenTelemetry (ADOT) or OpenTelemetry Instrumentation][xray-otel-migration-docs] to generate traces (through manual or zero-code instrumentation) from your application and send them to AWS X-Ray. OpenTelemetry is the industry-wide standard for tracing instrumentation and observability. It has a large open-source community for support and provides more instrumentations and updates. By adopting an OpenTelemetry solution, developers can leverage the latest services and innovations from AWS CloudWatch. ## :mega: End-of-Support on February 25, 2027 [The AWS X-Ray SDKs will reach end-of-support on **`February 25, 2027`**][xray-sdk-daemon-timeline]. After end-of-support, the X-Ray SDKs will no longer receive updates or releases. Previously published releases will continue to be available via public package managers and the source code will remain on GitHub. [xray-otel-migration-docs]: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-migration.html [xray-sdk-daemon-timeline]: https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-eos.html ------------------------------------- ### OpenTelemetry Python with AWS X-Ray AWS X-Ray supports using OpenTelemetry Python and the AWS Distro for OpenTelemetry (ADOT) Collector to instrument your application and send trace data to X-Ray. The OpenTelemetry SDKs are an industry-wide standard for tracing instrumentation. They provide more instrumentations and have a larger community for support, but may not have complete feature parity with the X-Ray SDKs. See [choosing between the ADOT and X-Ray SDKs](https://docs.aws.amazon.com/xray/latest/devguide/xray-instrumenting-your-app.html#xray-instrumenting-choosing) for more help with choosing between the two. If you want additional features when tracing your Python applications, please [open an issue on the OpenTelemetry Python Instrumentation repository](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/new?labels=feature-request&template=feature_request.md&title=X-Ray%20Compatible%20Feature%20Request). ### Python Versions End-of-Support Notice AWS X-Ray SDK for Python versions `>2.11.0` has dropped support for Python 2.7, 3.4, 3.5, and 3.6. -------------------------------------  ## Installing The AWS X-Ray SDK for Python is compatible with Python 3.7, 3.8, 3.9, 3.10, and 3.11. Install the SDK using the following command (the SDK's non-testing dependencies will be installed). ``` pip install aws-xray-sdk ``` To install the SDK's testing dependencies, use the following command. ``` pip install tox ``` ## Getting Help Use the following community resources for getting help with the SDK. We use the GitHub issues for tracking bugs and feature requests. * Ask a question in the [AWS X-Ray Forum](https://forums.aws.amazon.com/forum.jspa?forumID=241&start=0). * Open a support ticket with [AWS Support](http://docs.aws.amazon.com/awssupport/latest/user/getting-started.html). * If you think you may have found a bug, open an [issue](https://github.com/aws/aws-xray-sdk-python/issues/new). ## Opening Issues If you encounter a bug with the AWS X-Ray SDK for Python, we want to hear about it. Before opening a new issue, search the [existing issues](https://github.com/aws/aws-xray-sdk-python/issues) to see if others are also experiencing the issue. Include the version of the AWS X-Ray SDK for Python, Python language, and botocore/boto3 if applicable. In addition, include the repro case when appropriate. The GitHub issues are intended for bug reports and feature requests. For help and questions about using the AWS SDK for Python, use the resources listed in the [Getting Help](https://github.com/aws/aws-xray-sdk-python#getting-help) section. Keeping the list of open issues lean helps us respond in a timely manner. ## Documentation The [developer guide](https://docs.aws.amazon.com/xray/latest/devguide) provides in-depth guidance about using the AWS X-Ray service. The [API Reference](http://docs.aws.amazon.com/xray-sdk-for-python/latest/reference/) provides guidance for using the SDK and module-level documentation. ## Quick Start ### Configuration ```python from aws_xray_sdk.core import xray_recorder xray_recorder.configure( sampling=False, context_missing='LOG_ERROR',
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 2.15.0 | Imported from PyPI (2.15.0) | Low | 4/21/2026 |
| 2.14.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 6/4/2024 |
| 2.13.1 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 5/20/2024 |
| 2.13.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 3/6/2024 |
| 2.12.1 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 10/12/2023 |
| 2.12.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 4/3/2023 |
| 2.11.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 11/10/2022 |
| 2.10.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 6/30/2022 |
| 2.9.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 12/6/2021 |
| 2.8.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 4/29/2021 |
| 2.7.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 3/24/2021 |
| 2.6.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 6/8/2020 |
| 2.5.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 4/14/2020 |
| 2.4.3 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 12/6/2019 |
| 2.4.2 | bugfix: Fix exception processing in Django running in Lambda. #145 bugfix: Poller threads block main thread from exiting bug. #144 | Low | 3/5/2019 |
| 2.4.1 | Bug fix: Middlewares should create subsegments only when in the Lambda context running under a Lambda environment #139 | Low | 2/28/2019 |
| 2.4.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) | Low | 2/26/2019 |
| 2.3.0 | Please see the detailed changes here https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst | Low | 1/11/2019 |
| 2.2.0 | See details in [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst). | Low | 10/5/2018 |
| 2.1.0 | Please see the detailed changes here https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst | Low | 9/5/2018 |
| 2.0.0 | See https://docs.aws.amazon.com/xray/latest/devguide/xray-console-sampling.html for how to create sampling rules using X-Ray console. See https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python-configuration.html#xray-sdk-python-configuration-sampling for how to use the SDK with sampling rules. | Low | 8/29/2018 |
| 1.1 | See [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) for more details. | Low | 5/15/2018 |
| 1.0 | The SDK now is in production stability. Please see more details on [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst). | Low | 4/19/2018 |
| 0.97 | See [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) for details. | Low | 3/28/2018 |
| 0.96 | See [CHANGELOG](https://github.com/aws/aws-xray-sdk-python/blob/master/CHANGELOG.rst) for release details. | Low | 3/1/2018 |
| 0.95 | You can now use the SDK to instrument aioboto3/aiobotocore clients and asynchronous functions. | Low | 12/12/2017 |
| 0.94 | You can now use the SDK to instrument aiohttp clients. | Low | 11/15/2017 |
| v0.93 | You can follow the project and submit issues and pull requests on GitHub. | Low | 10/10/2017 |
