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/06/26 03:16:57 UTC

[GitHub] [skywalking-python] alonelaval opened a new pull request #25: add flask plugin

alonelaval opened a new pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25


   add flask plugin....


----------------------------------------------------------------
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



[GitHub] [skywalking-python] kezhenxu94 commented on a change in pull request #25: add flask plugin

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25#discussion_r445950561



##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)

Review comment:
       And, can we get the response of the request, then we can determine the span's status by the http status code, like other plugins

##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])

Review comment:
       Are these environment variables (`REMOTE_ADDR`, `REMOTE_PORT`) generally set when using Flask? If not, it's not appropriate to get the `peer` from these two

##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)

Review comment:
       And better to have a sanity check here, `entry_span` is possible to be `None`

##########
File path: tests/plugin/sw_flask/services/consumer.py
##########
@@ -0,0 +1,48 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from urllib import request
+
+from skywalking import agent, config
+
+if __name__ == '__main__':
+    config.service_name = 'consumer'
+    config.logging_level = 'DEBUG'
+    agent.start()
+
+    import socketserver
+    from http.server import BaseHTTPRequestHandler
+
+    class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):

Review comment:
       It'd be better to use Flask as well in the `consumer` service, we can check the propagation of context by that

##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)

Review comment:
       We don't actually have a `log` method on `Span` type, please implement it first

##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)

Review comment:
       Please also mark the span as `error` by setting `error_occurred` to `True`

##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)
+            return _handle_user_exception(this, e)
+
+        Flask.full_dispatch_request = _sw_full_dispatch_request
+        Flask.handle_user_exception = _sw_handle_user_exception
+
+    except Exception:
+        logger.warning('failed to install plugin %s', __name__)
+        traceback.print_exc()

Review comment:
       I suggest not to print the traceback in this plugin, other plugins are for built-in libraries, which are rarely failed to install, but this plugin is tend to be failed because not all users are using Flask




----------------------------------------------------------------
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



[GitHub] [skywalking-python] alonelaval commented on a change in pull request #25: add flask plugin

Posted by GitBox <gi...@apache.org>.
alonelaval commented on a change in pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25#discussion_r445955025



##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])

Review comment:
       yes  these environment variables  come from every request .




----------------------------------------------------------------
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



[GitHub] [skywalking-python] alonelaval commented on a change in pull request #25: add flask plugin

Posted by GitBox <gi...@apache.org>.
alonelaval commented on a change in pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25#discussion_r445955223



##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)
+            return _handle_user_exception(this, e)
+
+        Flask.full_dispatch_request = _sw_full_dispatch_request
+        Flask.handle_user_exception = _sw_handle_user_exception
+
+    except Exception:
+        logger.warning('failed to install plugin %s', __name__)
+        traceback.print_exc()

Review comment:
       ok
   




----------------------------------------------------------------
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



[GitHub] [skywalking-python] wu-sheng commented on pull request #25: Add Flask plugin

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25#issuecomment-652825923


   Forse push and close? What happens?


----------------------------------------------------------------
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



[GitHub] [skywalking-python] alonelaval commented on a change in pull request #25: add flask plugin

Posted by GitBox <gi...@apache.org>.
alonelaval commented on a change in pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25#discussion_r445956272



##########
File path: tests/plugin/sw_flask/services/consumer.py
##########
@@ -0,0 +1,48 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from urllib import request
+
+from skywalking import agent, config
+
+if __name__ == '__main__':
+    config.service_name = 'consumer'
+    config.logging_level = 'DEBUG'
+    agent.start()
+
+    import socketserver
+    from http.server import BaseHTTPRequestHandler
+
+    class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):

Review comment:
       ok
   




----------------------------------------------------------------
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



[GitHub] [skywalking-python] alonelaval commented on a change in pull request #25: add flask plugin

Posted by GitBox <gi...@apache.org>.
alonelaval commented on a change in pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25#discussion_r445955787



##########
File path: skywalking/plugins/sw_flask/__init__.py
##########
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import logging
+import traceback
+
+from skywalking import Layer, Component
+from skywalking.trace import tags
+from skywalking.trace.carrier import Carrier
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import Tag
+
+logger = logging.getLogger(__name__)
+
+
+def install():
+    # noinspection PyBroadException
+    try:
+        from flask import Flask
+        _full_dispatch_request = Flask.full_dispatch_request
+
+        _handle_user_exception = Flask.handle_user_exception
+
+        def _sw_full_dispatch_request(this: Flask):
+            import flask
+            req = flask.request
+            context = get_context()
+            carrier = Carrier()
+            for item in carrier:
+                item.val = req.headers[item.key.capitalize()]
+            with context.new_entry_span(op=req.path, carrier=carrier) as span:
+                span.layer = Layer.Http
+                span.component = Component.Flask
+                span.peer = '%s:%s' % (req.environ["REMOTE_ADDR"], req.environ["REMOTE_PORT"])
+                span.tag(Tag(key=tags.HttpMethod, val=req.method))
+                span.tag(Tag(key=tags.HttpUrl, val=req.url))
+                return _full_dispatch_request(this)
+
+        def _sw_handle_user_exception(this: Flask, e):
+            if e is not None:
+                entry_span = get_context().active_span()
+                entry_span.log(e)

Review comment:
       ok,i use skywalking 6.6 test... i will use skywalking 8.0.1 test first.




----------------------------------------------------------------
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



[GitHub] [skywalking-python] kezhenxu94 closed pull request #25: Add Flask plugin

Posted by GitBox <gi...@apache.org>.
kezhenxu94 closed pull request #25:
URL: https://github.com/apache/skywalking-python/pull/25


   


----------------------------------------------------------------
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