azure-monitor-opentelemetry-exporter: HTTP dependency target rendered as host:None when server.port is absent
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 92/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- azure, python
Línea de trabajo
Empieza en azure/monitor/opentelemetry/exporter/export/trace/_utils.py, en _get_target_and_path_for_http_dependency, y ejecuta después la reproducción proporcionada usando únicamente SERVER_ADDRESS. Se considera terminado cuando la ausencia de server.port produce ('example.com', '/'), mientras que un 443 explícito permanece sin modificar y 8443 sigue incluido en el target.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Package / version
azure-monitor-opentelemetry-exporter==1.0.0b57(viaazure-monitor-opentelemetry==1.8.10)azure-core==1.41.0- Present on
mainas of time of this writing (2026-10-03)
Description
When an HTTP client span has server.address but no server.port attribute, _get_target_and_path_for_http_dependency renders the dependency target with a literal None port, e.g.:
target = "<host>.vault.azure.net:None"
azure-core's DistributedTracingPolicy produces exactly this attribute shape for any request to a default-port URL. It sets server.address from the hostname, but only sets server.port when the URL has an explicit port (azure/core/pipeline/policies/_distributed_tracing.py):
if parsed_url.hostname:
attributes[self._SERVER_ADDRESS] = parsed_url.hostname
if parsed_url.port:
attributes[self._SERVER_PORT] = parsed_url.port
So every Azure SDK call to a standard HTTPS endpoint is affected. Observed in production App Insights (dependencies table):
| target | name |
|---|---|
<host>.vault.azure.net:None |
GET /secrets |
login.microsoftonline.com:None |
POST /.../token |
Root cause
azure/monitor/opentelemetry/exporter/export/trace/_utils.py,
_get_target_and_path_for_http_dependency (~line 201 on main):
server_port = attributes.get(server_attributes.SERVER_PORT)
# if not default port, include port in target
if server_port != default_port:
target = "{}:{}".format(target, server_port)
attributes.get(...) returns None when the attribute is absent, and
None != default_port is True, so None gets formatted into the target.
The DB path in the same file already guards against this, in _get_target_for_db_dependency (~line 247):
server_port = attributes.get(server_attributes.SERVER_PORT)
if server_port and server_port != _get_default_port_db(str(db_system)):
target = "{}:{}".format(target, server_port)
The HTTP path is missing the same guard.
Reproduction
from opentelemetry.semconv.attributes import server_attributes
from azure.monitor.opentelemetry.exporter.export.trace._utils import (
_get_target_and_path_for_http_dependency,
)
_get_target_and_path_for_http_dependency(
{server_attributes.SERVER_ADDRESS: "example.com"}
)
# -> ('example.com:None', '/') expected ('example.com', '/')
For comparison, with an explicit port the function behaves correctly:
SERVER_PORT=443->('example.com', '/')SERVER_PORT=8443->('example.com:8443', '/')
Suggested fix
Mirror the DB-path guard:
- if server_port != default_port:
+ if server_port and server_port != default_port:
target = "{}:{}".format(target, server_port)
Impact
- Default-port dependencies show
host:Noneas their target in App Insights.
- Lenguaje dominante
- Python
- Estrellas
- 5.6k
- Forks
- 3.4k
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 206
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/azure-sdk-for-python
-
EngSys
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Azure/azure-sdk-for-python#49614 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Teams Chatbot]: Clarify Python dev-feed publication from a branch versus PyPI releasePosiblemente ocupada @jianingwang123 la tomó hace 5 días. Abiertocustomer-reported question
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Azure/azure-sdk-for-python#49548 · 1 comentario · 2 reacciones · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
Client customer-reported Hosted Agents needs-team-attention question Service Attention
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Azure/azure-sdk-for-python#49477 · 4 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
azure-ai-evaluation: a content-harm score of 0 (no harm) is parsed as NaN in _parse_content_harm_response (numeric branch uses 0 < x instead of 0 <= x)Posiblemente ocupada @pujitha24 la tomó hace 21 días. AbiertoEvaluation Service Attention
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Azure/azure-sdk-for-python#49190 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Update CODEOWNERSAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Azure/azure-sdk-for-python#49183 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de Azure/azure-sdk-for-python
Issues similares
-
idxmax/idxmin raise ValueError when a single partition is all-NAPosiblemente ocupada @Jason10191019999 la tomó hoy. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
Old versions of datamodelsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
[BUG]: Windows GUI package of v1.17.0-rc3 has no GTK DLLsPosiblemente ocupada @andrut-ds la tomó hoy. Abiertobug CI/CD Pactus-GUI Windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
pactus-project/pactus#2428 ·
Los mantenedores suelen responder en 1 día
-
DiskDataset.reshard() can hang with a zero or negative shard sizePosiblemente ocupada @Programmer-Develops la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 19 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
GNS3/gns3-server#3017 · 1 comentario ·
Los mantenedores suelen responder en 1 día