You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/11/20 16:49:06 UTC

[GitHub] [skywalking-python] tom-pytel commented on a change in pull request #85: [Plugin] http servers set URL and status tags

tom-pytel commented on a change in pull request #85:
URL: https://github.com/apache/skywalking-python/pull/85#discussion_r527821714



##########
File path: skywalking/plugins/sw_http_server.py
##########
@@ -53,15 +61,38 @@ def _wrap_run_wsgi():
         carrier = Carrier()
         for item in carrier:
             item.val = handler.headers[item.key.capitalize()]
-        with context.new_entry_span(op=handler.path, carrier=carrier) as span:
+        path = handler.path or '/'
+        with context.new_entry_span(op=path.split("?")[0], carrier=carrier) as span:
+            url = 'http://' + handler.headers["Host"] + path if 'Host' in handler.headers else path
             span.layer = Layer.Http
             span.component = Component.General
             span.peer = '%s:%s' % handler.client_address
             span.tag(Tag(key=tags.HttpMethod, val=handler.command))
-            return _run_wsgi()
+            span.tag(Tag(key=tags.HttpUrl, val=url))

Review comment:
       That is what I meant with the previous PR that the tags changed, but in that case only failing cases would change, with this change normal tests will change so yes they may need to be updated to expect the new tag.
   
   Maybe will look into setting up test env but don't have too much more to add, maybe an sw_wsgiref plugin but will see, so for now lets see how this test comes back and hope its an easy fix.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org