Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .riot/requirements/13c3933.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/13c3933.in
#
anyio==4.14.2
attrs==26.1.0
certifi==2026.7.22
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.0.0
httpx2==2.0.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
typing-extensions==4.16.0
31 changes: 31 additions & 0 deletions .riot/requirements/143e698.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/143e698.in
#
anyio==4.14.2
attrs==26.1.0
backports-asyncio-runner==1.2.0
coverage[toml]==7.15.4
exceptiongroup==1.3.1
h11==0.16.0
httpcore2==2.12.0
httpx2==2.12.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
tomli==2.4.1
truststore==0.10.4
typing-extensions==4.16.0
31 changes: 31 additions & 0 deletions .riot/requirements/1e7c279.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1e7c279.in
#
anyio==4.14.2
attrs==26.1.0
backports-asyncio-runner==1.2.0
certifi==2026.7.22
coverage[toml]==7.15.4
exceptiongroup==1.3.1
h11==0.16.0
httpcore2==2.0.0
httpx2==2.0.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
tomli==2.4.1
typing-extensions==4.16.0
27 changes: 27 additions & 0 deletions .riot/requirements/2a0ccf2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/2a0ccf2.in
#
anyio==4.14.2
attrs==26.1.0
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.12.0
httpx2==2.12.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
truststore==0.10.4
28 changes: 28 additions & 0 deletions .riot/requirements/a77aa22.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/a77aa22.in
#
anyio==4.14.2
attrs==26.1.0
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.12.0
httpx2==2.12.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
truststore==0.10.4
typing-extensions==4.16.0
27 changes: 27 additions & 0 deletions .riot/requirements/da479b1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is autogenerated by pip-compile with Python 3.14
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/da479b1.in
#
anyio==4.14.2
attrs==26.1.0
certifi==2026.7.22
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.0.0
httpx2==2.0.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
27 changes: 27 additions & 0 deletions .riot/requirements/e49b70d.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is autogenerated by pip-compile with Python 3.14
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/e49b70d.in
#
anyio==4.14.2
attrs==26.1.0
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.12.0
httpx2==2.12.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
truststore==0.10.4
28 changes: 28 additions & 0 deletions .riot/requirements/e9af4c9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/e9af4c9.in
#
anyio==4.14.2
attrs==26.1.0
certifi==2026.7.22
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.0.0
httpx2==2.0.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
typing-extensions==4.16.0
28 changes: 28 additions & 0 deletions .riot/requirements/f2c3ec9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/f2c3ec9.in
#
anyio==4.14.2
attrs==26.1.0
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.12.0
httpx2==2.12.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
truststore==0.10.4
typing-extensions==4.16.0
33 changes: 33 additions & 0 deletions .riot/requirements/f38b0e1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/f38b0e1.in
#
anyio==4.12.1
attrs==26.1.0
backports-asyncio-runner==1.2.0
certifi==2026.7.22
coverage[toml]==7.10.7
exceptiongroup==1.3.1
h11==0.16.0
httpcore2==2.0.0
httpx2==2.0.0
hypothesis==6.45.0
idna==3.19
importlib-metadata==8.7.1
iniconfig==2.1.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==8.4.2
pytest-asyncio==1.2.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.0.1
sortedcontainers==2.4.0
tomli==2.4.1
typing-extensions==4.16.0
zipp==3.23.1
27 changes: 27 additions & 0 deletions .riot/requirements/fd33cd8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/fd33cd8.in
#
anyio==4.14.2
attrs==26.1.0
certifi==2026.7.22
coverage[toml]==7.15.4
h11==0.16.0
httpcore2==2.0.0
httpx2==2.0.0
hypothesis==6.45.0
idna==3.19
iniconfig==2.3.0
mock==5.2.0
opentracing==2.4.0
packaging==26.3
pluggy==1.6.0
pygments==2.21.0
pytest==9.1.1
pytest-asyncio==1.4.0
pytest-cov==7.1.0
pytest-mock==3.15.1
pytest-randomly==4.1.0
sortedcontainers==2.4.0
1 change: 1 addition & 0 deletions ddtrace/_monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"gevent": True,
"graphql": True,
"grpc": True,
"httpx2": True,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the httpx2 disable flag for aliased imports

When an application calls httpx2.alias_httpx() and sets DD_TRACE_HTTPX2_ENABLED=false (or calls patch_all(httpx2=False)), this entry is disabled but the existing httpx hook remains active. Because httpx then refers to the same aliased module, the HTTPX patch still wraps its clients and emits spans using config.httpx, so users cannot disable HTTPX2 instrumentation without also disabling the separate HTTPX integration. Coordinate the hooks or detect the aliased module so the HTTPX2 enablement setting remains authoritative.

AGENTS.md reference: AGENTS.md:L59-L62

Useful? React with 👍 / 👎.

@dubloom dubloom Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man this is self sabotaging if someone is doing that

"httpx": True,
"kafka": True,
"langgraph": True,
Expand Down
19 changes: 3 additions & 16 deletions ddtrace/contrib/internal/httpx/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
from ddtrace.contrib._events.http_client import HttpClientEvents
from ddtrace.contrib._events.http_client import HttpClientRequestEvent
from ddtrace.contrib._events.http_client import HttpClientSendEvent
from ddtrace.contrib.internal.trace_utils import ext_service
from ddtrace.ext import SpanKind
from ddtrace.internal import core
from ddtrace.internal.compat import ensure_binary
from ddtrace.internal.compat import ensure_text
from ddtrace.internal.constants import COMPONENT
from ddtrace.internal.settings import env
Expand All @@ -23,6 +21,7 @@
from ddtrace.internal.utils.version import parse_version
from ddtrace.internal.utils.wrappers import unwrap as _u

from .utils import httpx_get_service_name
from .utils import httpx_url_to_str


Expand All @@ -48,18 +47,6 @@ def _supported_versions() -> dict[str, str]:
return {"httpx": ">=0.25"}


def _get_service_name(request: httpx.Request) -> Optional[str]:
if config.httpx.split_by_domain:
if hasattr(request.url, "netloc"):
return ensure_text(request.url.netloc, errors="backslashreplace")

service = ensure_binary(request.url.host)
if request.url.port:
service += b":" + ensure_binary(str(request.url.port))
return ensure_text(service, errors="backslashreplace")
return ext_service(None, config.httpx)


def _wrapped_sync_send_single_request(
wrapped: "BoundFunctionWrapper[..., httpx.Response]",
instance: httpx.Client,
Expand Down Expand Up @@ -121,7 +108,7 @@ async def _wrapped_async_send(
with core.context_with_event(
HttpClientRequestEvent(
http_operation="http.request",
service=_get_service_name(req),
service=httpx_get_service_name(req, config.httpx),
component=config.httpx.integration_name,
request_method=req.method,
request_headers=req.headers,
Expand Down Expand Up @@ -153,7 +140,7 @@ def _wrapped_sync_send(
HttpClientRequestEvent(
component=config.httpx.integration_name,
http_operation="http.request",
service=_get_service_name(req),
service=httpx_get_service_name(req, config.httpx),
request_method=req.method,
request_headers=req.headers,
integration_config=config.httpx,
Expand Down
Loading
Loading