Clarify the component id (#74)
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 @@
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 @@
Span.tag(entrySpan, "kong.service_name", service.name)
end
end
+ Span.setComponentId(ngx.ctx.exitSpan, 6001)
tracer:finish()
end
@@ -77,4 +79,4 @@
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 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>