Provide annotation to control opentracing

By default you might want opentracing off, but on for a particular
ingress.

Similarly, you might want opentracing globally on, but disabled for
a specific endpoint. To achieve this, `opentracing_propagate_context`
cannot be set when combined with `opentracing off`

A new annotation, `enable-opentracing` allows more fine grained control
of opentracing for specific ingresses.
This commit is contained in:
Will Thames 2019-10-30 13:30:01 +10:00
parent 40e0e5bef8
commit 0ae463a5f3
8 changed files with 214 additions and 0 deletions

View file

@ -962,8 +962,17 @@ stream {
set $location_path {{ $location.Path | escapeLiteralDollar | quote }};
{{ if $all.Cfg.EnableOpentracing }}
{{ if and $location.Opentracing.Set (not $location.Opentracing.Enabled) }}
opentracing off;
{{ else }}
{{ opentracingPropagateContext $location }};
{{ end }}
{{ else }}
{{ if and $location.Opentracing.Set $location.Opentracing.Enabled }}
opentracing on;
{{ opentracingPropagateContext $location }};
{{ end }}
{{ end }}
{{ if $location.Mirror.URI }}
mirror {{ $location.Mirror.URI }};