Class ThresholdLoggingTracer
- java.lang.Object
-
- com.couchbase.client.core.cnc.tracing.ThresholdLoggingTracer
-
- All Implemented Interfaces:
RequestTracer
public class ThresholdLoggingTracer 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
ThresholdLoggingTracer.Builder
The builder used to configure theThresholdLoggingTracer
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ThresholdLoggingTracer.Builder
builder(EventBus eventBus)
Deprecated.please usecreate(EventBus, ThresholdLoggingTracerConfig)
instead.ThresholdLoggingTracerConfig
config()
Returns the current configuration.static ThresholdLoggingTracer
create(EventBus eventBus)
Short-hand to create the tracer with the event bus that needs to be used.static ThresholdLoggingTracer
create(EventBus eventBus, ThresholdLoggingTracerConfig config)
Creates a tracer with config and a reference to the event bus.RequestSpan
requestSpan(String name, RequestSpan parent)
Creates a new request span with or without a parent.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 ThresholdLoggingTracer.Builder builder(EventBus eventBus)
Deprecated.please usecreate(EventBus, ThresholdLoggingTracerConfig)
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 ThresholdLoggingTracer 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 ThresholdLoggingTracer create(EventBus eventBus, ThresholdLoggingTracerConfig 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.
-
config
public ThresholdLoggingTracerConfig config()
Returns the current configuration.
-
requestSpan
public RequestSpan requestSpan(String name, RequestSpan parent)
Description copied from interface:RequestTracer
Creates a new request span with or without a parent.- Specified by:
requestSpan
in interfaceRequestTracer
- Parameters:
name
- the name of the toplevel operation (i.e. "cb.get")parent
- a parent, if no parent is used supply null.- 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
-
-