Class NoopTracer
java.lang.Object
org.opensearch.telemetry.tracing.noop.NoopTracer
- All Implemented Interfaces:
Closeable,AutoCloseable,Tracer,TransportTracer
No-op implementation of Tracer
- Opensearch.internal:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the current span.booleanTells if the traces are being recorded or notstartScopedSpan(SpanCreationContext spanCreationContext) Start the span and scoped it.startSpan(SpanCreationContext context) Starts theSpanwith givenSpanCreationContextstartSpan(SpanCreationContext spanCreationContext, Map<String, Collection<String>> header) Start 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
-
isRecording
public boolean isRecording()Description copied from interface:TracerTells if the traces are being recorded or not- Specified by:
isRecordingin interfaceTracer- Returns:
- boolean
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
startSpan
public Span startSpan(SpanCreationContext spanCreationContext, Map<String, Collection<String>> header) Description copied from interface:TransportTracerStart the span with propagating the tracing info from the HttpRequest header.- Specified by:
startSpanin interfaceTransportTracer- Parameters:
spanCreationContext- span name.header- transport headers- Returns:
- the span instance
-