zipkin-finagle
zipkin-finagle copied to clipboard
Add enabled property to disable auto-loading
there's been a couple hints that we could make it possible to disable auto-loading of tracers. I'm not sure if that would be possible with code change here or not
https://github.com/linkerd/linkerd-zipkin/pull/4#issuecomment-279820571 w/ @klingerf and also a similar request recently on gitter by @komsit37 who is manually registering an http tracer and doesn't want a default one to pop up.
cc @mosesn for insight if we should add an "enabled" flag or if there are other things related to look at
@adriancole we have a generic facility for disabling specific auto-loaded tracers in LoadService, but it requires passing in a flag or java system properties, so it might not be what you want.
https://github.com/twitter/util/blob/develop/util-app/src/main/scala/com/twitter/finagle/util/flags.scala#L24
Sorry for the delay in getting back to you, was on vacation for the past couple weeks.
Thanks tons for the insight, @mosesn! hope the vacation was a nice one.
@komsit37 does something like this work for you?
-Dcom.twitter.finagle.util.loadServiceDenied=zipkin.finagle.http.HttpZipkinTracer
Thanks @mosesn @adriancole! Yes, that's a good option. But now that I think about it again, if I'm gonna pass a flag anyway, I might as well just use flag to define zipkin host!
It's not clear from the README that providing your own HttpZipkinTracer and using it via .withTracer will actually result in 2 Tracers running. One of which will be pointing to localhost:9411. It's hard to detect when this is happening because the default sample rate is 0.001 so most requests won't cause the error.
The loadServiceDenied flag above fixed the problem, although it feels a little brittle hardcoding the value, thanks!