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

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


The following commit(s) were added to refs/heads/master by this push:
     new b78f080  Clarify the component id (#74)
b78f080 is described below

commit b78f08023b3625ce829adb0bec4cb7abd2bccf4c
Author: Daming <[email protected]>
AuthorDate: Thu Apr 15 22:27:35 2021 +0800

    Clarify the component id (#74)
---
 kong/plugins/skywalking/handler.lua | 4 +++-
 lib/skywalking/tracer.lua           | 4 ----
 test/e2e/e2e-test/kong/pom.xml      | 2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/kong/plugins/skywalking/handler.lua 
b/kong/plugins/skywalking/handler.lua
index cc93e7a..58a9a6e 100644
--- a/kong/plugins/skywalking/handler.lua
+++ b/kong/plugins/skywalking/handler.lua
@@ -55,6 +55,7 @@ end
 function SkyWalkingHandler:body_filter(config)
     if ngx.arg[2] and kong.ctx.plugin.skywalking_sample then
         local entrySpan = ngx.ctx.entrySpan
+        Span.setComponentId(entrySpan, 6001)
         Span.tag(entrySpan, 'kong.node', kong.node.get_hostname())
 
         local service = kong.router.get_service()
@@ -68,6 +69,7 @@ function SkyWalkingHandler:body_filter(config)
                 Span.tag(entrySpan, "kong.service_name", service.name)
             end
         end
+        Span.setComponentId(ngx.ctx.exitSpan, 6001)
 
         tracer:finish()
     end
@@ -77,4 +79,4 @@ function SkyWalkingHandler:log(config)
     tracer:prepareForReport()
 end
 
-return SkyWalkingHandler
\ No newline at end of file
+return SkyWalkingHandler
diff --git a/lib/skywalking/tracer.lua b/lib/skywalking/tracer.lua
index f4f850b..88941b2 100644
--- a/lib/skywalking/tracer.lua
+++ b/lib/skywalking/tracer.lua
@@ -26,10 +26,6 @@ local metadata_shdict = ngx.shared.tracing_buffer
 local ngx = ngx
 local nginxComponentId = 6000
 
-if kong then
-    nginxComponentId = 6001
-end
-
 
 local Tracer = {}
 
diff --git a/test/e2e/e2e-test/kong/pom.xml b/test/e2e/e2e-test/kong/pom.xml
index 93bbdd7..c4a74f0 100644
--- a/test/e2e/e2e-test/kong/pom.xml
+++ b/test/e2e/e2e-test/kong/pom.xml
@@ -74,7 +74,7 @@
                             </run>
                         </image>
                         <image>
-                            <name>kong:2.3.3-centos</name>
+                            <name>kong:2.3.3</name>
                             <alias>kong-with-skywalking</alias>
                             <run>
                                 <volumes>

Reply via email to