You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/02/27 13:48:13 UTC

[skywalking-nginx-lua] branch doc-update created (now b1c6d78)

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

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


      at b1c6d78  Submit doc about how to debug startup env.

This branch includes the following new commits:

     new b1c6d78  Submit doc about how to debug startup env.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking-nginx-lua] 01/01: Submit doc about how to debug startup env.

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b1c6d783a330226097ffaf5a1742e179d49d8886
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Feb 27 21:46:02 2020 +0800

    Submit doc about how to debug startup env.
---
 README.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/README.md b/README.md
index 066a865..906c8ff 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,28 @@ http {
 ```
 
 # Set up dev env
+### Debug Startup
+By using the `/examples/nginx.conf`, you could start the Nginx with LUA module or OpenResty. Such as `nginx -c /path/to/skywalking-nginx-lua/examples/nginx.conf`
+Then you could
+1. See the `register logs` happens on the console log.
+```
+2020/02/27 09:22:06 [debug] 20676#11799235: *4 [lua] content_by_lua(nginx.conf:118):4: Service register request = {"services":[{"type":"normal","serviceName":"User Service Name"}]}
+2020/02/27 09:22:06 [debug] 20676#11799235: *2 [lua] client.lua:99: registerService(): Service register response = [{"key":"User Service Name","value":1}]
+
+2020/02/27 09:22:06 [debug] 20676#11799235: *2 [lua] client.lua:106: registerService(): Service registered, service id = 1
+2020/02/27 09:22:06 [debug] 20676#11799235: *4 [lua] content_by_lua(nginx.conf:134):3: Service instance register request = {"instances":[{"time":1582766526928,"instanceUUID":"name:User Service Instance Name","properties":[{"key":"language","value":"Lua"}],"serviceId":1}]}
+2020/02/27 09:22:06 [debug] 20676#11799235: *2 [lua] client.lua:143: registerServiceInstance(): Service Instance register response = [{"key":"name:User Service Instance Name","value":1}]
+2020/02/27 09:22:06 [debug] 20676#11799235: *2 [lua] client.lua:150: registerServiceInstance(): Service Instance registered, service instance id = 1
+```
+
+2. Access the `http://127.0.0.1:8080/ingress` then you could see the tracing happens and reported spans in the logs.
+```
+2020/02/27 09:22:10 [debug] 20676#11799235: *9 [lua] tracer.lua:91: prepareForReport(): segment = {"spans":[{"operationName":"\/tier2\/lb","startTime":1582766530125,"endTime":1582766530139,"spanType":"Exit","spanId":1,"isError":false,"parentSpanId":0,"componentId":6000,"peer":"User Service Name-nginx:upstream_ip:port","spanLayer":"HTTP"},{"operationName":"\/tier2\/lb","startTime":1582766530125,"tags":[{"key":"http.method","value":"GET"},{"key":"http.params","value":"http:\/\/127.0.0.1\/t [...]
+2020/02/27 09:22:10 [debug] 20676#11799235: *9 [lua] tracer.lua:95: prepareForReport(): segment buffer size = 1
+2020/02/27 09:22:10 [debug] 20676#11799235: *6 [lua] tracer.lua:91: prepareForReport(): segment = {"spans":[{"operationName":"\/ingress","startTime":1582766530114,"endTime":1582766530140,"spanType":"Exit","spanId":1,"isError":false,"parentSpanId":0,"componentId":6000,"peer":"User Service Name-nginx:upstream_ip:port","spanLayer":"HTTP"},{"operationName":"\/ingress","startTime":1582766530114,"tags":[{"key":"http.method","value":"GET"},{"key":"http.params","value":"http:\/\/127.0.0.1\/ingre [...]
+```
+
+### Local Development and Unit Tests
 All codes in the `lib/skywalking` require the `*_test.lua` to do the UnitTest. To run that, you need to install
 - Lua 5.3
 - LuaRocks