Fix opentracing configuration when multiple options are configured (#2075)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-02-12 16:08:49 -08:00 committed by GitHub
parent 80462ecdad
commit 33475b7184
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 22 deletions

View file

@ -11,17 +11,7 @@
load_module /etc/nginx/modules/ngx_http_modsecurity_module.so;
{{ end }}
{{ if $cfg.EnableOpentracing }}
load_module /etc/nginx/modules/ngx_http_opentracing_module.so;
{{ end }}
{{ if (and $cfg.EnableOpentracing (ne $cfg.ZipkinCollectorHost "")) }}
load_module /etc/nginx/modules/ngx_http_zipkin_module.so;
{{ end }}
{{ if (and $cfg.EnableOpentracing (ne $cfg.JaegerCollectorHost "")) }}
load_module /etc/nginx/modules/ngx_http_jaeger_module.so;
{{ end }}
{{ buildOpentracingLoad $cfg }}
daemon off;
@ -107,17 +97,8 @@ http {
{{ if $cfg.EnableOpentracing }}
opentracing on;
{{ end }}
{{ if (and $cfg.EnableOpentracing (ne $cfg.ZipkinCollectorHost "")) }}
zipkin_collector_host {{ $cfg.ZipkinCollectorHost }};
zipkin_collector_port {{ $cfg.ZipkinCollectorPort }};
zipkin_service_name {{ $cfg.ZipkinServiceName }};
{{ else if (and $cfg.EnableOpentracing (ne $cfg.JaegerCollectorHost "")) }}
jaeger_reporter_local_agent_host_port {{ $cfg.JaegerCollectorHost }}:{{ $cfg.JaegerCollectorPort }};
jaeger_service_name {{ $cfg.JaegerServiceName }};
jaeger_sampler_type {{ $cfg.JaegerSamplerType }};
jaeger_sampler_param {{ $cfg.JaegerSamplerParam }};
{{ end }}
{{ buildOpentracing $cfg }}
include /etc/nginx/mime.types;
default_type text/html;