def set_http_attributes(
        self: AbstractSpan, request: HttpRequestType, response: Optional[HttpResponseType] = None
    ) -> None:
        """
        Add correct attributes for a http client span.

        :param request: The request made
        :type request: azure.core.rest.HttpRequest
        :param response: The response received from the server. Is None if no response received.
        :type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
        """
        # Also see https://github.com/python/mypy/issues/5837
        self.kind = SpanKind.CLIENT
        self.add_attribute(HttpSpanMixin._SPAN_COMPONENT, "http")
        self.add_attribute(HttpSpanMixin._HTTP_METHOD, request.method)
        self.add_attribute(HttpSpanMixin._HTTP_URL, request.url)

        parsed_url = urlparse(request.url)
        if parsed_url.hostname:
            self.add_attribute(HttpSpanMixin._NET_PEER_NAME, parsed_url.hostname)
        if parsed_url.port and parsed_url.port not in [80, 443]:
            self.add_attribute(HttpSpanMixin._NET_PEER_PORT, parsed_url.port)

        user_agent = request.headers.get("User-Agent")
        if user_agent:
            self.add_attribute(HttpSpanMixin._HTTP_USER_AGENT, user_agent)
        if response and response.status_code:
            self.add_attribute(HttpSpanMixin._HTTP_STATUS_CODE, response.status_code)
        else:
            self.add_attribute(HttpSpanMixin._HTTP_STATUS_CODE, 504)

        Add correct attributes for a http client span.

        :param request: The request made
        :type request: azure.core.rest.HttpRequest
        :param response: The response received from the server. Is None if no response received.
        :type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
        
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/core/tracing/_abstract_span.py