opencensus-java icon indicating copy to clipboard operation
opencensus-java copied to clipboard

Add ability to propagate Tracer object to TimeLimitedHandler externally instead of using singleton

Open Jokser opened this issue 6 years ago • 0 comments

Currently, a TimeLimitedHandler used for span exporting accesses to Tracer object instance using the singleton approach: private static final Tracer tracer = Tracing.getTracer(); If TraceComponent has created externally (not in Tracing class) there is no ability to propagate Tracer from that component to exporter that uses TimeLimited export approach (e.g. Zipkin). This problem derives from https://github.com/census-instrumentation/opencensus-java/issues/1952 I think the Tracer object can be propagated to TimeLimitedHandler through constructor instead of a singleton. It gives more possibility to re-using existing span exporters code base without visible negative effects.

Jokser avatar Jul 23 '19 16:07 Jokser