Class ThresholdRequestTracer
- java.lang.Object
-
- com.couchbase.client.core.cnc.tracing.ThresholdRequestTracer
-
- All Implemented Interfaces:
RequestTracer
public class ThresholdRequestTracer extends Object implements RequestTracer
The default tracing implementation, which tracks the top N slowest requests per service and dumps them at configurable intervals.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThresholdRequestTracer.Builder
The builder used to configure theThresholdRequestTracer
.
-
Field Summary
-
Fields inherited from interface com.couchbase.client.core.cnc.RequestTracer
DISPATCH_SPAN_NAME, PAYLOAD_ENCODING_SPAN_NAME, SERVICE_IDENTIFIER_ANALYTICS, SERVICE_IDENTIFIER_KV, SERVICE_IDENTIFIER_QUERY, SERVICE_IDENTIFIER_SEARCH, SERVICE_IDENTIFIER_VIEW
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ThresholdRequestTracer.Builder
builder(EventBus eventBus)
Deprecated.please usecreate(EventBus, ThresholdRequestTracerConfig)
instead.static ThresholdRequestTracer
create(EventBus eventBus)
Short-hand to create the tracer with the event bus that needs to be used.static ThresholdRequestTracer
create(EventBus eventBus, ThresholdRequestTracerConfig config)
Creates a tracer with config and a reference to the event bus.InternalSpan
internalSpan(String operationName, RequestSpan parent)
Creates a new span that represents a full request/response lifecycle in the SDK.RequestSpan
requestSpan(String operationName, RequestSpan parent)
Creates a new span that is created from the underlying tracer.Mono<Void>
start()
Starts the tracer if it hasn't been started, might be a noop depending on the implementation.Mono<Void>
stop(Duration timeout)
Stops the tracer if it has been started previously, might be a noop depending on the implementation.
-
-
-
Method Detail
-
builder
public static ThresholdRequestTracer.Builder builder(EventBus eventBus)
Deprecated.please usecreate(EventBus, ThresholdRequestTracerConfig)
instead.Creates a builder to customize this tracer.- Parameters:
eventBus
- the event bus where the final events will be emitted into.- Returns:
- the builder to customize.
-
create
public static ThresholdRequestTracer create(EventBus eventBus)
Short-hand to create the tracer with the event bus that needs to be used.- Parameters:
eventBus
- the event bus where the final events will be emitted into.- Returns:
- the created tracer ready to be used.
-
create
public static ThresholdRequestTracer create(EventBus eventBus, ThresholdRequestTracerConfig config)
Creates a tracer with config and a reference to the event bus.- Parameters:
eventBus
- the event bus where the final events will be emitted into.config
- the config that should be used.- Returns:
- the created tracer ready to be used.
-
internalSpan
public InternalSpan internalSpan(String operationName, RequestSpan parent)
Description copied from interface:RequestTracer
Creates a new span that represents a full request/response lifecycle in the SDK.- Specified by:
internalSpan
in interfaceRequestTracer
- Parameters:
operationName
- the name of the toplevel operation (i.e. "get")parent
- the parent, can be null.- Returns:
- an internal span representing the toplevel request.
-
requestSpan
public RequestSpan requestSpan(String operationName, RequestSpan parent)
Description copied from interface:RequestTracer
Creates a new span that is created from the underlying tracer.- Specified by:
requestSpan
in interfaceRequestTracer
- Parameters:
operationName
- the name of the toplevel operation (i.e. "get")parent
- a possible parent.- Returns:
- a request span that wraps the actual tracer implementation span.
-
start
public Mono<Void> start()
Description copied from interface:RequestTracer
Starts the tracer if it hasn't been started, might be a noop depending on the implementation.- Specified by:
start
in interfaceRequestTracer
-
stop
public Mono<Void> stop(Duration timeout)
Description copied from interface:RequestTracer
Stops the tracer if it has been started previously, might be a noop depending on the implementation.- Specified by:
stop
in interfaceRequestTracer
-
-