From c0de2a217f125c7102e1e49525faae2b3ec4c252 Mon Sep 17 00:00:00 2001 From: Emmett Butler <723615+emmettbutler@users.noreply.github.com> Date: Fri, 18 Aug 2023 08:26:21 -0700 Subject: [PATCH] docs(asgi): clarify python version requirements for AsyncioContextProvider (#6686) This pull request updates the documentation of ASGI integrations to be clearer about the requirements of legacy Python versions, and to conform with [this docstring](https://github.com/DataDog/dd-trace-py/blob/45532233f6e9e70c84c2946aab06513c947f4500/ddtrace/contrib/asyncio/provider.py#L12). ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --- ddtrace/contrib/asgi/__init__.py | 3 +-- ddtrace/contrib/fastapi/__init__.py | 3 +-- ddtrace/contrib/sanic/__init__.py | 3 +-- ddtrace/contrib/starlette/__init__.py | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ddtrace/contrib/asgi/__init__.py b/ddtrace/contrib/asgi/__init__.py index 12022307ee6..5c37497c2ab 100644 --- a/ddtrace/contrib/asgi/__init__.py +++ b/ddtrace/contrib/asgi/__init__.py @@ -12,8 +12,7 @@ ddtrace-run uvicorn app:app -If using Python 3.6, the legacy ``AsyncioContextProvider`` will have to be -enabled before using the middleware:: +On Python 3.6 and below, you must enable the legacy ``AsyncioContextProvider`` before using the middleware:: from ddtrace.contrib.asyncio.provider import AsyncioContextProvider from ddtrace import tracer # Or whichever tracer instance you plan to use diff --git a/ddtrace/contrib/fastapi/__init__.py b/ddtrace/contrib/fastapi/__init__.py index e79b24d9759..4e2e69c65b6 100644 --- a/ddtrace/contrib/fastapi/__init__.py +++ b/ddtrace/contrib/fastapi/__init__.py @@ -16,8 +16,7 @@ app = FastAPI() -If using Python 3.6, the legacy ``AsyncioContextProvider`` will have to be -enabled before using the middleware:: +On Python 3.6 and below, you must enable the legacy ``AsyncioContextProvider`` before using the middleware:: from ddtrace.contrib.asyncio.provider import AsyncioContextProvider from ddtrace import tracer # Or whichever tracer instance you plan to use diff --git a/ddtrace/contrib/sanic/__init__.py b/ddtrace/contrib/sanic/__init__.py index 44a1959a5a1..0264b98a4c5 100644 --- a/ddtrace/contrib/sanic/__init__.py +++ b/ddtrace/contrib/sanic/__init__.py @@ -23,8 +23,7 @@ def index(request): if __name__ == '__main__': app.run() -If using Python 3.6, the legacy ``AsyncioContextProvider`` will have to be -enabled before using the middleware:: +On Python 3.6 and below, you must enable the legacy ``AsyncioContextProvider`` before using the middleware:: from ddtrace.contrib.asyncio.provider import AsyncioContextProvider from ddtrace import tracer # Or whichever tracer instance you plan to use diff --git a/ddtrace/contrib/starlette/__init__.py b/ddtrace/contrib/starlette/__init__.py index 26b205d446e..c3799749b0a 100644 --- a/ddtrace/contrib/starlette/__init__.py +++ b/ddtrace/contrib/starlette/__init__.py @@ -17,8 +17,7 @@ app = Starlette() -If using Python 3.6, the legacy ``AsyncioContextProvider`` will have to be -enabled before using the middleware:: +On Python 3.6 and below, you must enable the legacy ``AsyncioContextProvider`` before using the middleware:: from ddtrace.contrib.asyncio.provider import AsyncioContextProvider from ddtrace import tracer # Or whichever tracer instance you plan to use