Skip to content

Commit 6909e86

Browse files
authored
Merge pull request #431 from mplemay/fix-telemetry-warning
fix: opentelemetry warning
2 parents ac46dd6 + 6e7fba7 commit 6909e86

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"] = str(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)