azure-monitor-opentelemetry-exporter: HTTP dependency target rendered as host:None when server.port is absent
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 92/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- azure, python
- Ambito
- backend-api-design, observability
Direzione di ricerca
Inizia in azure/monitor/opentelemetry/exporter/export/trace/_utils.py, in _get_target_and_path_for_http_dependency, quindi esegui la riproduzione fornita usando solo SERVER_ADDRESS. Il lavoro è completato quando l'assenza di server.port produce ('example.com', '/'), mentre un 443 esplicito rimane invariato e 8443 resta incluso nel target.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 5.6k
- Fork
- 3.4k
- Merge medio
- 2g 3h
- PR unite (30g)
- 206
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/azure-sdk-for-python
-
[Teams Chatbot]: Clarify Python dev-feed publication from a branch versus PyPI releaseForse già presa @jianingwang123 l’ha presa 3 giorni fa. Apertacustomer-reported question
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Azure/azure-sdk-for-python#49548 · 1 commento · 2 reazioni · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
Client customer-reported Hosted Agents needs-team-attention question Service Attention
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Azure/azure-sdk-for-python#49477 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
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)Forse già presa @pujitha24 l’ha presa 19 giorni fa. ApertaEvaluation Service Attention
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Azure/azure-sdk-for-python#49190 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Update CODEOWNERSAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
Azure/azure-sdk-for-python#49183 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
azure-ai-evaluation: PromptyEvaluatorBase falls back to the first digit anywhere in the judge's reply, and the threshold turns a stray digit into a wrong pass/fail (15 evaluators)Forse già presa @wasim-builds l’ha presa 13 giorni fa. ApertaEvaluation Service Attention
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Azure/azure-sdk-for-python#49153 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Azure/azure-sdk-for-python
Issue simili
-
`lvm_compact` has no self-hosted twin, and `docs/158` §5 says every language-face component mustApertabug sev-3 vm
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sierra-research/tau2-bench#635 ·
I maintainer di solito rispondono entro 1 giorno
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python onesForse già presa @fmuia l’ha presa oggi. Apertadocumentation skill
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
lnccbrown/ssm-simulators#406 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
btclib-org/btclib-ecc#309 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
autowarefoundation/autoware_carla_scenario#281 ·
I maintainer di solito rispondono entro 1 giorno