Package org.apache.solr.opentelemetry
Class ClosableTracerShim
- java.lang.Object
-
- org.apache.solr.opentelemetry.ClosableTracerShim
-
- All Implemented Interfaces:
io.opentracing.Tracer
,Closeable
,AutoCloseable
public class ClosableTracerShim extends Object implements io.opentracing.Tracer
Delegate shim that forwards all calls to the actualOpenTracingShim
, and in addition callsSdkTracerProvider.close()
to really close the OTEL SDK tracer when the OT shim is closed.TODO: This can be removed once we migrate Solr instrumentation from OpenTracing to OpenTelemetry
-
-
Constructor Summary
Constructors Constructor Description ClosableTracerShim(io.opentracing.Tracer shim, io.opentelemetry.sdk.trace.SdkTracerProvider sdkTracerProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.opentracing.Scope
activateSpan(io.opentracing.Span span)
io.opentracing.Span
activeSpan()
io.opentracing.Tracer.SpanBuilder
buildSpan(String operationName)
void
close()
<C> io.opentracing.SpanContext
extract(io.opentracing.propagation.Format<C> format, C carrier)
<C> void
inject(io.opentracing.SpanContext spanContext, io.opentracing.propagation.Format<C> format, C carrier)
io.opentracing.ScopeManager
scopeManager()
-
-
-
Method Detail
-
scopeManager
public io.opentracing.ScopeManager scopeManager()
- Specified by:
scopeManager
in interfaceio.opentracing.Tracer
-
activeSpan
public io.opentracing.Span activeSpan()
- Specified by:
activeSpan
in interfaceio.opentracing.Tracer
-
activateSpan
public io.opentracing.Scope activateSpan(io.opentracing.Span span)
- Specified by:
activateSpan
in interfaceio.opentracing.Tracer
-
buildSpan
public io.opentracing.Tracer.SpanBuilder buildSpan(String operationName)
- Specified by:
buildSpan
in interfaceio.opentracing.Tracer
-
inject
public <C> void inject(io.opentracing.SpanContext spanContext, io.opentracing.propagation.Format<C> format, C carrier)
- Specified by:
inject
in interfaceio.opentracing.Tracer
-
extract
public <C> io.opentracing.SpanContext extract(io.opentracing.propagation.Format<C> format, C carrier)
- Specified by:
extract
in interfaceio.opentracing.Tracer
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceio.opentracing.Tracer
-
-