This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/master by this push:
     new 10f5dbd  Add component ID for requests plugin (#33)
10f5dbd is described below

commit 10f5dbdc1952d23e5cbddf75548ca87e2d378d3a
Author: huawei <[email protected]>
AuthorDate: Sun Jul 5 21:27:44 2020 +0800

    Add component ID for requests plugin (#33)
---
 .gitignore                                 | 4 ++--
 skywalking/__init__.py                     | 1 +
 skywalking/plugins/sw_requests/__init__.py | 2 +-
 tests/plugin/sw_flask/expected.data.yml    | 2 +-
 tests/plugin/sw_requests/expected.data.yml | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index be223d3..ae05d35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,5 +6,5 @@
 __pycache__
 build/
 dist/
-skywalking_python.egg-info/
-*.pyc
\ No newline at end of file
+*.pyc
+/apache_skywalking.egg-info/
\ No newline at end of file
diff --git a/skywalking/__init__.py b/skywalking/__init__.py
index 1dd5b45..f826ad6 100644
--- a/skywalking/__init__.py
+++ b/skywalking/__init__.py
@@ -25,6 +25,7 @@ class Component(Enum):
     Unknown = 0
     General = 7000  # built-in modules that may not have a logo to display
     Flask = 7001
+    Requests = 7002
 
 
 class Layer(Enum):
diff --git a/skywalking/plugins/sw_requests/__init__.py 
b/skywalking/plugins/sw_requests/__init__.py
index b1b6d02..32860a6 100644
--- a/skywalking/plugins/sw_requests/__init__.py
+++ b/skywalking/plugins/sw_requests/__init__.py
@@ -53,7 +53,7 @@ def install():
             carrier = Carrier()
             with context.new_exit_span(op=url_param.path or "/", 
peer=url_param.netloc, carrier=carrier) as span:
                 span.layer = Layer.Http
-                span.component = Component.General
+                span.component = Component.Requests
 
                 if headers is None:
                     headers = {}
diff --git a/tests/plugin/sw_flask/expected.data.yml 
b/tests/plugin/sw_flask/expected.data.yml
index aa3d2dc..3e9d0b3 100644
--- a/tests/plugin/sw_flask/expected.data.yml
+++ b/tests/plugin/sw_flask/expected.data.yml
@@ -67,7 +67,7 @@ segmentItems:
                 value: '200'
             startTime: gt 0
             endTime: gt 0
-            componentId: 7000
+            componentId: 7002
             spanType: Exit
             peer: provider:9091
             skipAnalysis: false
diff --git a/tests/plugin/sw_requests/expected.data.yml 
b/tests/plugin/sw_requests/expected.data.yml
index e85480f..bfd3a76 100644
--- a/tests/plugin/sw_requests/expected.data.yml
+++ b/tests/plugin/sw_requests/expected.data.yml
@@ -63,7 +63,7 @@ segmentItems:
                 value: '200'
             startTime: gt 0
             endTime: gt 0
-            componentId: 7000
+            componentId: 7002
             spanType: Exit
             peer: provider:9091
             skipAnalysis: false

Reply via email to