dynatrace-oss / OneAgent-SDK-Python-AutoInstrumentation

autodynatrace, a python library that implements automatic instrumentation using the OneAgent SDK for Python
Other
62 stars 28 forks source link

Get the URL directly from urllib3 #14

Closed dlopes7 closed 4 years ago

dlopes7 commented 4 years ago

urllib3: The f-string at https://github.com/dlopes7/autodynatrace/blob/9c8a9cc2bf8fa9bbd098dfa0fe4aefec85d44f9a/autodynatrace/wrappers/urllib3.py#L34 seems questionable. Won't it always add a port, even if 80/443 are used for HTTP/S? Isn't there a method to get the full URL already in urllib3?

dlopes7 commented 4 years ago

No, the closer we get from urllib3 is:

    def _absolute_url(self, path):
        return Url(scheme=self.scheme, host=self.host, port=self.port, path=path).url

Which gives the exact same results