-
Notifications
You must be signed in to change notification settings - Fork 467
Open
Labels
Description
Tracer Version(s)
latest 3.17
Python Version(s)
3.12
Pip Version(s)
25.1.1
Bug Report
When using ddtrace with Dapr (or any gRPC client that uses a dns:-prefixed target such as dns:127.0.0.1:50001), Datadog’s internal gRPC instrumentation logs a warning:
Non-integer port in target 'dns:127.0.0.1:50001'
This is caused by _parse_target_from_args prepending "//" before calling urllib.parse.urlsplit(), which makes urlsplit unable to parse the hostname and port correctly.
Reproduction Code
- Use a Dapr client configuration that uses dns:127.0.0.1:50001 as the gRPC endpoint.
- Run a traced application with ddtrace-run and send a publish event via the Dapr client.
from urllib import parse
from ddtrace.contrib.internal.grpc import utils
target = "dns:127.0.0.1:50001"
# Simulate ddtrace behavior
parsed = parse.urlsplit("//" + target if not target.startswith("//") else target)
print(parsed.hostname, parsed.port)
Error Logs
WARNING ddtrace.contrib.internal.grpc.utils _parse_target_from_args Non-integer port in target 'dns:127.0.0.1:50001'
Libraries in Use
dapr-ext-fastapi = "1.15.0"
fastapi = "0.115.12"
uvicorn = "0.30.4"
ddtrace = "^3.15.0"
Operating System
Windows