zipkin-finagle icon indicating copy to clipboard operation
zipkin-finagle copied to clipboard

Add enabled property to disable auto-loading

Open codefromthecrypt opened this issue 8 years ago • 4 comments

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

codefromthecrypt avatar Jun 22 '17 10:06 codefromthecrypt

@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.

mosesn avatar Jun 28 '17 22:06 mosesn

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

codefromthecrypt avatar Jun 29 '17 07:06 codefromthecrypt

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!

komsit37 avatar Jul 05 '17 14:07 komsit37

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!

ryanb93 avatar Jan 24 '19 10:01 ryanb93