openzipkin/zipkin4net

Make flush.timeout configurable

Opened this issue · 1 comments

I'm adding zipkin support to an asp.net application that performs very long-running web service calls, e.g. 30 seconds to 10 minutes, to third-party services. As a result my traces will run for over a minute a pretty sizable percentage of the time and Zipkin4net thus ends up logging a flush.timeout tag. This is annoying, but this also seems to cause unknownservice and unknownrpc to override the service and rpc names I send and which show up correctly when flush.timeout is not hit.

It would be great if, for example, TraceManager exposed a FlushTimeout property, or it could be provided as an additional optional argument to the ZipkinTracer constructor instead of it being hardcoded to TimeSpan.FromMinutes(1) deep inside MutableSpanMap.

I'm aware that this timeout exists to defend against memory leaks but in my case, and I imagine many others, one minute is nowhere near enough time and I believe I've defended well enough against memory leaks elsewhere.

fedj commented

Hi @jpotisch,

I understand your case and it should be configurable.
Having it in TraceManager would make it hard to propagate once ZipkinTracer has been instanciated.
On the other hand, flush.timeout is not supposed to change at runtime. I would suggest to put it there.

Would you be able to come up with a PR ?