@ThreadSafe
public final class DisruptorAsyncSpanProcessor
extends java.lang.Object
implements io.opentelemetry.sdk.trace.SpanProcessor
SpanProcessor
implementation that uses Disruptor
to execute all the hooks on an
async thread.
Configuration options for DisruptorAsyncSpanProcessor
can be read from system
properties, environment variables, or Properties
objects.
For system properties and Properties
objects, DisruptorAsyncSpanProcessor
will look for the following names:
otel.disruptor.buffer.size
: number of events that can be enqueued at any one time.
otel.disruptor.blocking
: to block the queue if no space available.
otel.disruptor.num.retries
: number of retries for the SleepingWaitStrategy
.
otel.disruptor.sleeping.time
: waiting time in ns for the SleepingWaitStrategy
.
For environment variables, DisruptorAsyncSpanProcessor
will look for the following
names:
OTEL_DISRUPTOR_BUFFER_SIZE
: number of events that can be enqueued at any one time.
OTEL_DISRUPTOR_BLOCKING
: to block the queue if no space available.
OTEL_DISRUPTOR_NUM_RETRIES
: number of retries for the SleepingWaitStrategy
.
OTEL_DISRUPTOR_SLEEPING_TIME
: waiting time in ns for the SleepingWaitStrategy
.
Modifier and Type | Class and Description |
---|---|
static class |
DisruptorAsyncSpanProcessor.Builder
Builder class for
DisruptorAsyncSpanProcessor . |
Modifier and Type | Method and Description |
---|---|
io.opentelemetry.sdk.common.CompletableResultCode |
forceFlush() |
boolean |
isEndRequired() |
boolean |
isStartRequired() |
static DisruptorAsyncSpanProcessor.Builder |
newBuilder(io.opentelemetry.sdk.trace.SpanProcessor spanProcessor)
Returns a new Builder for
DisruptorAsyncSpanProcessor . |
void |
onEnd(io.opentelemetry.sdk.trace.ReadableSpan span) |
void |
onStart(io.opentelemetry.sdk.trace.ReadWriteSpan span) |
io.opentelemetry.sdk.common.CompletableResultCode |
shutdown() |
public void onStart(io.opentelemetry.sdk.trace.ReadWriteSpan span)
onStart
in interface io.opentelemetry.sdk.trace.SpanProcessor
public boolean isStartRequired()
isStartRequired
in interface io.opentelemetry.sdk.trace.SpanProcessor
public void onEnd(io.opentelemetry.sdk.trace.ReadableSpan span)
onEnd
in interface io.opentelemetry.sdk.trace.SpanProcessor
public boolean isEndRequired()
isEndRequired
in interface io.opentelemetry.sdk.trace.SpanProcessor
public io.opentelemetry.sdk.common.CompletableResultCode shutdown()
shutdown
in interface io.opentelemetry.sdk.trace.SpanProcessor
public io.opentelemetry.sdk.common.CompletableResultCode forceFlush()
forceFlush
in interface io.opentelemetry.sdk.trace.SpanProcessor
public static DisruptorAsyncSpanProcessor.Builder newBuilder(io.opentelemetry.sdk.trace.SpanProcessor spanProcessor)
DisruptorAsyncSpanProcessor
.spanProcessor
- the List<SpanProcessor>
to where the Span's events are pushed.DisruptorAsyncSpanProcessor
.java.lang.NullPointerException
- if the spanProcessor
is null
.