Skip to content

Commit e2b3ae7

Browse files
committed
fix: opentelemetry warning
1 parent ac46dd6 commit e2b3ae7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/http/httpx/kiota_http/httpx_request_adapter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,12 +601,14 @@ def get_request_from_request_information(
601601

602602
otel_attributes = {
603603
HTTP_REQUEST_METHOD: method.value,
604-
"http.port": url.port,
605604
SERVER_ADDRESS: url.hostname,
606605
URL_SCHEME: url.scheme,
607606
"url.uri_template": request_info.url_template,
608607
}
609608

609+
if url.port is not None:
610+
otel_attributes["http.port"] = url.port
611+
610612
if self.observability_options.include_euii_attributes:
611613
otel_attributes.update({URL_FULL: url.geturl()})
612614

0 commit comments

Comments
 (0)