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/03/03 02:51:17 UTC

[GitHub] [skywalking] JaredTan95 edited a comment on issue #4399: [WIP]support http api for upstream trace.

JaredTan95 edited a comment on issue #4399: [WIP]support http api for upstream trace.
URL: https://github.com/apache/skywalking/pull/4399#issuecomment-593739280
 
 
   By following @kezhenxu94 ,  oap and java app are mounted into e2e container. But, nginx could,t connect to upstream only when Lua agent registering as the following configuration:
   
   ```conf
   http {
       lua_package_path "/usr/share/skywalking-nginx-lua/lib/skywalking/?.lua;;";
       # Buffer represents the register inform and the queue of the finished segment
       lua_shared_dict tracing_buffer 100m;
   
       # Init is the timer setter and keeper
       # Setup an infinite loop timer to do register and trace report.
       init_worker_by_lua_block {
           local metadata_buffer = ngx.shared.tracing_buffer
   
           metadata_buffer:set('serviceName', 'User_Service_Name')
           -- Instance means the number of Nginx deloyment, does not mean the worker instances
           metadata_buffer:set('serviceInstanceName', 'User_Service_Instance_Name')
   
           require("client"):startBackendTimer("http://upstream:12800")
       }
       log_format sw_trace escape=json "$uri $request_body";
   
       server {
           listen 8080;
   
           location /e2e/users {
   
               rewrite_by_lua_block {
                   require("tracer"):startBackendTimer()
               }
   
               proxy_pass http://upstream:9090/e2e/users;
   
               body_filter_by_lua_block {
                   require("tracer"):finish()
               }
   
               log_by_lua_block {
                   require("tracer"):prepareForReport()
               }
           }
   
           location /health-check {
   
               rewrite_by_lua_block {
                   require("tracer"):startBackendTimer()
               }
   
               proxy_pass http://upstream:9090/e2e/health-check;
   
               body_filter_by_lua_block {
                   require("tracer"):finish()
               }
   
               log_by_lua_block {
                   require("tracer"):prepareForReport()
               }
           }
       }
   }
   ```
   
   BTW, according to log, `upstream:9090/e2e/users` connected successfully.

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


With regards,
Apache Git Services