From e347fa754145ea80bce0eac0c0a80a8d30290a9a Mon Sep 17 00:00:00 2001 From: kamalhussain Date: Wed, 9 Jun 2021 11:20:06 -0500 Subject: [PATCH] Update __init__.py (#537) --- .../src/opentelemetry/instrumentation/wsgi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index 24303a8ac..823ede790 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -118,7 +118,7 @@ def collect_request_attributes(environ): } host_port = environ.get("SERVER_PORT") - if host_port is not None: + if host_port is not None and not host_port == "": result.update({SpanAttributes.NET_HOST_PORT: int(host_port)}) setifnotnone(result, SpanAttributes.HTTP_HOST, environ.get("HTTP_HOST"))