linkerd2
linkerd2 copied to clipboard
Configurable tracing service name
Part of solution for https://github.com/linkerd/linkerd2/issues/11157
linkerd2-proxy part: https://github.com/linkerd/linkerd2-proxy/pull/2856
Introduces new annotation config.linkerd.io/tracing-service-name
which allows to set custom tracing service name for proxy.
P.S. Another potential solution would be to use template instead of fixed name, which would allow to set annotation once for namespace, for example. But it has it's own drawback, that in this case we would have to use Pod name or something similar in this template. So, i think the solution with fixed service name annotation is the best.
Hi @GrigoriyMikhalkin. Thanks for taking the time to submit this and sorry for the delay and getting you a review.
I'm curious about a slightly modified approach that might lessen the change required. Specifically, I don't think we should anything about tracing should be part of the linkerd-control-plane chart if we can avoid it. Tell me if you think this could work:
jaeger/injector/mutator/patch.go includes tracing-specific proxy configuration, so we should aim to instrument this here. I don't think that we need a new helm value to do this... instead we can use the downward API to reference a dedicated annotation that controls this parameter to set an environment variable. (I'd suggest something like jaeger.linkerd.io/proxy-service-name.) Then, the proxy can use that value as override if it is set and not empty...
Hi @olix0r!
I agree that use of downward API allows more elegant solution. Updated the PR.
One thing to note is, proxy now relies on annotation named jaeger.linkerd.io/proxy-service-name
to be consistent with tracing-enabled
annotation. Even though users could use exporters other than Jaeger(e.g. Zipkin). Probably it would make sense to rename these annotations at some point.
Hi @olix0r!
I updated this PR to be up-to-date.