SEANK.H.LIAO

ingress-nginx opentracing

docs are few and far between

ingress-nginx

Don't ask me why I'm using the default ingress-nginx, I just have to. Anyway, I want to try out its integration with jaeger

config

minimal

Annoyingly I spent 4 hours only to realize the reason my ingress was crashing was because the docs show the latest master but I'm running the latest release, and the jaeger-endpoint config option was very recent.

1data:
2  enable-opentracing: "true"
3  # agent host (udp/6831) adjust accordingly
4  jaeger-collector-host: jaeger.jaeger.svc.cluster.local
5
6  # takes precedence over collector-host
7  # only available after 0.44.0
8  # jaeger-endpoint: "http://jaeger.jaeger.svc.cluster.local:14268/api/traces"
other

For reasons, the default config is a bit useless: each request generates 2 spans: both with the name service name nginx and the operation name being the Ingress path, which for most people is just /.

Thankfully, they can be customized, especially useful are the available log fields

 1data:
 2  # rename the service
 3  jaeger-service-name: nginx-default
 4
 5  # outer span
 6  opentracing-operation-name: "$request_method $host"
 7  # inner span
 8  opentracing-location-operation-name: "$namespace $service_name"
 9
10  # don't kill jaeger
11  jaeger-sampler-type: ratelimiting
12  jaeger-sampler-param: "5"