Class NoopTracer
java.lang.Object
org.opensearch.telemetry.tracing.noop.NoopTracer
- All Implemented Interfaces:
Closeable,AutoCloseable,HttpTracer,Tracer
No-op implementation of Tracer
- Opensearch.internal:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the current span.startScopedSpan(SpanCreationContext spanCreationContext) Start the span and scoped it.startSpan(SpanCreationContext context) Starts theSpanwith givenSpanCreationContextStart the span with propagating the tracing info from the HttpRequest header.withSpanInScope(Span span) Creates the Span Scope for a current thread.
-
Field Details
-
INSTANCE
No-op Tracer instance
-
-
Method Details
-
startSpan
Description copied from interface:TracerStarts theSpanwith givenSpanCreationContext -
getCurrentSpan
Description copied from interface:TracerReturns the current span.- Specified by:
getCurrentSpanin interfaceTracer- Returns:
- current wrapped span.
-
startScopedSpan
Description copied from interface:TracerStart the span and scoped it. This must be used for scenarios whereSpanScopeandSpanlifecycles are same and ends within the same thread where created.- Specified by:
startScopedSpanin interfaceTracer- Parameters:
spanCreationContext- span creation context- Returns:
- scope of the span, must be closed with explicit close or with try-with-resource
-
withSpanInScope
Description copied from interface:TracerCreates the Span Scope for a current thread. It's mandatory to scope the span just after creation so that it will automatically manage the attach /detach to the current thread.- Specified by:
withSpanInScopein interfaceTracer- Parameters:
span- span to be scoped- Returns:
- ScopedSpan
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
startSpan
Description copied from interface:HttpTracerStart the span with propagating the tracing info from the HttpRequest header.- Specified by:
startSpanin interfaceHttpTracer- Parameters:
spanCreationContext- span name.header- http request header.- Returns:
- span.
-