项目作者: rnburn

项目描述 :
Instrument nginx for OpenTracing.
高级语言: C++
项目地址: git://github.com/rnburn/nginx-opentracing.git
创建时间: 2017-03-27T19:44:02Z
项目社区:https://github.com/rnburn/nginx-opentracing

开源协议:

下载


The repo has moved.

https://github.com/opentracing-contrib/nginx-opentracing

nginx-opentracing

Enable requests served by nginx for distributed tracing via The OpenTracing Project.

Dependencies

Docker

A docker image rnburn/nginx-opentracing is provided to support using nginx with OpenTracing
in a manner analogous to the nginx Docker image.
See here for examples of how to use it.

Building

  1. $ tar zxvf nginx-1.9.x.tar.gz
  2. $ cd nginx-1.9.x
  3. $ export NGINX_OPENTRACING_VENDOR="ZIPKIN" # or export NGINX_OPENTRACING_VENDOR="LIGHTSTEP"
  4. $ ./configure --add-dynamic-module=/absolute/path/to/nginx-opentracing/opentracing \
  5. # To enable tracing with Zipkin
  6. --add-dynamic-module=/absolute/path/to/nginx-opentracing/zipkin \
  7. # To enable tracing with LightStep
  8. --add-dynamic-module=/absolute/path/to/nginx-opentracing/lightstep
  9. $ make && sudo make install

Getting Started

  1. # Load the OpenTracing dynamic module.
  2. load_module modules/ngx_http_opentracing_module.so;
  3. # Load a vendor OpenTracing dynamic module.
  4. # For example,
  5. # load_module modules/ngx_http_lightstep_module.so;
  6. # or
  7. # load_module modules/ngx_http_zipkin_module.so;
  8. http {
  9. # Configure your vendor's tracer.
  10. # For example,
  11. # lightstep_access_token ACCESSTOKEN;
  12. # ....
  13. # or
  14. # zipkin_collector_host localhost;
  15. # ...
  16. # Enable tracing for all requests.
  17. opentracing on;
  18. # Optionally, set additional tags.
  19. opentracing_tag http_user_agent $http_user_agent;
  20. location ~ \.php$ {
  21. # The operation name used for spans defaults to the name of the location
  22. # block, but you can use this directive to customize it.
  23. opentracing_operation_name $uri;
  24. fastcgi_pass 127.0.0.1:1025;
  25. }
  26. }

See Tutorial for a more complete example, Reference
for a list of available OpenTracing-related directives, and LightStep
and Zipkin for a list of vendor tracing directives.