codjust commented on issue #2151:
URL: https://github.com/apache/apisix/issues/2151#issuecomment-695760402


   Today I tried  nginx-opentracing  which build in openresy, really 
complicated.  Indeed, not suitable for integration into apisix.
   
   **Depend lib:**
   https://github.com/opentracing/opentracing-cpp
   https://github.com/jaegertracing/jaeger-client-cpp
   detail in: [CMakeLists.txt]( 
https://github.com/jaegertracing/jaeger-client-cpp/blob/master/CMakeLists.txt)
   
   **build option:**
   ```shell
   ./configure \
   --with-http_stub_status_module \
   --with-ipv6 \
   --with-http_v2_module \
   --with-http_realip_module \
   --without-luajit-gc64 \
   --with-compat \
   --add-dynamic-module=/path/nginx-opentracing/opentracing
   ```
   
   **Example:**
   ```
   load_module 
/usr/local/openresty/nginx/modules/ngx_http_opentracing_module.so;
   
   events {}
   
   http {
     opentracing on;
   
     opentracing_load_tracer /usr/local/lib/libjaegertracing.so 
./jaeger-config.json;
     upstream backend {
       server 127.0.0.1:8090;
     }
   
     server {
       error_log ./logs/debug.log debug;
       listen 8080;
       server_name localhost;
   
       location = / {
         opentracing_trace_locations off;
         proxy_pass http://backend;
         opentracing_propagate_context;
       }
     }
   }
   ```
   jaeger-config.json:
   ```json
   {
     "service_name": "openresty",
     "diabled": false,
     "reporter": {
       "logSpans": true,
       "endpoint":"http://192.168.0.14:14268/api/traces";
     },
     "sampler": {
       "type": "const",
       "param": "1"
     }
   }
   ```
   
   **Test:**
   `curl -iv http://127.0.0.1:8080`
   
   **UI:** 
   
![image](https://user-images.githubusercontent.com/14133490/93707017-0b1a6c00-fb5e-11ea-8a84-57cb427630b9.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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to