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 2021/09/19 04:27:56 UTC

[GitHub] [skywalking-nginx-lua] wangrzneu opened a new pull request #87: support setting backend http uri after init worker stage

wangrzneu opened a new pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87


   support setting backend http uri after init worker stage, then the the skywalking oap address can be configured dynamically.
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wu-sheng commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922559683


   All grpc service could have equal http service for language like Lua. 
   Yoi could send a pull request to SkyWalking backend server to support this.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wu-sheng commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922413981


   Which case could use this? There is no agent dynamic configuration for lua agent.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wangrzneu commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wangrzneu commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922476671


   > I mean who could run the change? LUA script is already hot-load supported by lua engine. From my understanding, only case requiring this is something similar with SkyWalking other language agents, which implemented DCS, but it is not implemented in Lua.
   
   Our service is deployed in K8s, we use a sidecar in the same pod to set the config. The nginx config is like,
   ```
   http {
       lua_package_path "/Path/to/.../skywalking-nginx-lua/lib/?.lua;;";
       lua_shared_dict tracing_buffer 100m;
       init_worker_by_lua_block {
           local metadata_buffer = ngx.shared.tracing_buffer
           metadata_buffer:set('serviceName', 'User Service Name')
           metadata_buffer:set('serviceInstanceName', 'User Service Instance Name')
           metadata_buffer:set('includeHostInEntrySpan', false)
           require("skywalking.util").set_randomseed()
           require("skywalking.client"):startBackendTimer("http://127.0.0.1:8080")
           skywalking_tracer = require("skywalking.tracer")
       }
   
       server {
           listen 8090;
   
           location /ingress {
               default_type text/html;
   
               rewrite_by_lua_block {
                   skywalking_tracer:start("upstream service")
               }
   
               proxy_pass http://127.0.0.1:8080/backend;
   
               body_filter_by_lua_block {
                   if ngx.arg[2] then
                       skywalking_tracer:finish()
                   end
               }
   
               log_by_lua_block {
                   skywalking_tracer:prepareForReport()
               }
           }
       }
       server {
           listen 9090;
   
           location /config {
               content_by_lua_block {
                   ngx.req.read_body()
                   local data = ngx.req.get_body_data()
                   local config = cjson.decode(data)
                   local metadata_buffer = ngx.shared.tracing_buffer
                   metadata_buffer:set('backendHttpUri', config.skywalking_oap_address)
               }
           }
       }
   }
   ```
   The config can be sent to `/config` interface in the 9090 port.
   The pod design diagram is like:
   ![未命名文件 (18)](https://user-images.githubusercontent.com/3406517/133929888-03ad9aed-7bd4-4133-8f55-cd72f44c73e9.png)
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wu-sheng commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922559890


   configmap and etcd, with many more configuration server supported already.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wangrzneu commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wangrzneu commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922498136


   > Do you know this? https://github.com/apache/skywalking-data-collect-protocol/blob/master/language-agent/ConfigurationDiscoveryService.proto
   > 
   > Typically in SkyWalking, we prefer you could implement config update through this.
   > 
   > Another topic is, this should not include URI. URI should be domain based, using dns and load balancer to rerouting.
   
   Get it. I prefer to implement dynamic config configmap or etcd, because there is no official grpc support for openresty.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wangrzneu commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wangrzneu commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922416458


   > Which case could use this? There is no agent dynamic configuration for lua agent.
   
   The skywalking oap server address may be changed, and we don't want to restart or reload the openresty instance in this case.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wangrzneu closed pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wangrzneu closed pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87


   


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wu-sheng commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922418325


   I mean who could run the change? LUA script is already hot-load supported by lua engine. From my understanding, only case requiring this is something similar with SkyWalking other language agents, which implemented DCS, but it is not implemented in Lua.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wu-sheng commented on pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87#issuecomment-922477214


   Do you know this? https://github.com/apache/skywalking-data-collect-protocol/blob/master/language-agent/ConfigurationDiscoveryService.proto
   
   Typically in SkyWalking, we prefer you could implement config update through this.
   
   Another topic is, this should not include URI. URI should be domain based, using dns and load balancer to rerouting.


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-nginx-lua] wangrzneu closed pull request #87: support setting backend http uri after init worker stage

Posted by GitBox <gi...@apache.org>.
wangrzneu closed pull request #87:
URL: https://github.com/apache/skywalking-nginx-lua/pull/87


   


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org