Skip to content

geekeren/docker-zipkin-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-zipkin-nginx

Dockerhub Dockerhub Dockerhub License

Dockerfile project for nginx supporting zipkin tracer

Supported tags and respective Dockerfile links

Usage

Pull the docker image:

docker pull distracing/zipkin-nginx

Run Docker with config files mounted

docker run -p 80:80 -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro -v $(pwd)/zipkin-nginx-config.json:/etc/zipkin-nginx/zipkin-nginx-config.json:ro distracing/zipkin-nginx:1.12

Configuration

The following is example code of nginx.conf and zipkin configuration. A example using docker-compose can be got in this repo: https://github.com/geekeren/docker-zipkin-nginx-example

Nginx.conf

load_module modules/ngx_http_opentracing_module.so;
events {
    worker_connections  1024;
}

http {
    opentracing_load_tracer /usr/local/lib/libzipkin_opentracing_plugin.so /etc/zipkin-nginx/zipkin-nginx-config.json;
    opentracing on;
    opentracing_trace_locations off;

    log_format tracing
    'traceId=$opentracing_context_x_b3_traceid '
    'spanId=$opentracing_context_x_b3_spanid ';

    server {
        listen 80;
        opentracing_propagate_context;
        location ~ {
            access_log  /var/log/nginx/access.log tracing;
            proxy_pass https://wangbaiyuan.cn;
            break;
        }
    }
}

Getting More information at:

zipkin-nginx-config.json

{
  "service_name": "zipkin-nginx",
  "sample_rate": 0
}

This zipkin configuration is created according to https://github.com/rnburn/zipkin-cpp-opentracing/blob/master/zipkin_opentracing/tracer_configuration.schema.json , you can go there to see more usages.

About

Dockerfile project for nginx supporting zipkin tracer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published