Class NoopRequestSpan
- java.lang.Object
-
- com.couchbase.client.core.cnc.tracing.NoopRequestSpan
-
- All Implemented Interfaces:
RequestSpan
public class NoopRequestSpan extends Object implements RequestSpan
A NOOP implementation of a request span, utilized by theNoopRequestTracer.Calling individual methods on this span won't do anything, since, well, it's a noop.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.couchbase.client.core.cnc.RequestSpan
RequestSpan.StatusCode
-
-
Field Summary
Fields Modifier and Type Field Description static NoopRequestSpanINSTANCEHolds a single, static representation of this span.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattribute(String key, boolean value)Sets an attribute on the span, which is translated to the corresponding implementation specific tag.voidattribute(String key, long value)Sets an attribute on the span, which is translated to the corresponding implementation specific tag.voidattribute(String key, String value)Sets an attribute on the span, which is translated to the corresponding implementation specific tag.voidend()Completes this span.voidevent(String name, Instant timestamp)Sets an event on the span, which is translated to the corresponding implementation specific event.voidrequestContext(RequestContext requestContext)Allows to set a request context to the request span.voidstatus(RequestSpan.StatusCode status)Sets the status of the span, which is by default UNSET.
-
-
-
Field Detail
-
INSTANCE
public static final NoopRequestSpan INSTANCE
Holds a single, static representation of this span.
-
-
Method Detail
-
attribute
public void attribute(String key, String value)
Description copied from interface:RequestSpanSets an attribute on the span, which is translated to the corresponding implementation specific tag.Note that, depending on the implementation, attributes might be ignored.
- Specified by:
attributein interfaceRequestSpan- Parameters:
key- the key of the attribute.value- the value of the attribute.
-
attribute
public void attribute(String key, boolean value)
Description copied from interface:RequestSpanSets an attribute on the span, which is translated to the corresponding implementation specific tag.Note that, depending on the implementation, attributes might be ignored.
- Specified by:
attributein interfaceRequestSpan- Parameters:
key- the key of the attribute.value- the value of the attribute.
-
attribute
public void attribute(String key, long value)
Description copied from interface:RequestSpanSets an attribute on the span, which is translated to the corresponding implementation specific tag.Note that, depending on the implementation, attributes might be ignored.
- Specified by:
attributein interfaceRequestSpan- Parameters:
key- the key of the attribute.value- the value of the attribute.
-
event
public void event(String name, Instant timestamp)
Description copied from interface:RequestSpanSets an event on the span, which is translated to the corresponding implementation specific event.Note that, depending on the implementation, events might be ignored.
- Specified by:
eventin interfaceRequestSpan- Parameters:
name- the name of the eventtimestamp- the timestamp when it happened.
-
status
public void status(RequestSpan.StatusCode status)
Description copied from interface:RequestSpanSets the status of the span, which is by default UNSET.Note that, depending on the implementation, this might be a no-op.
- Specified by:
statusin interfaceRequestSpan- Parameters:
status- the span's new status.
-
end
public void end()
Description copied from interface:RequestSpanCompletes this span.- Specified by:
endin interfaceRequestSpan
-
requestContext
public void requestContext(RequestContext requestContext)
Description copied from interface:RequestSpanAllows to set a request context to the request span.- Specified by:
requestContextin interfaceRequestSpan- Parameters:
requestContext- the request context, if present.
-
-