Package zipkin2.collector
Class Collector
java.lang.Object
zipkin2.collector.Collector
public class Collector extends Object
This component takes action on spans received from a transport. This includes deserializing,
sampling and scheduling for storage.
Callbacks passed do not propagate to the storage layer. They only return success or failures before storage is attempted. This ensures that calling threads are disconnected from storage threads.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Collector.Builder
-
Method Summary
Modifier and Type Method Description void
accept(List<Span> spans, Callback<Void> callback)
void
accept(List<Span> spans, Callback<Void> callback, Executor executor)
void
acceptSpans(byte[] serialized, Callback<Void> callback)
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
.void
acceptSpans(byte[] serializedSpans, BytesDecoder<Span> decoder, Callback<Void> callback)
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
.void
acceptSpans(ByteBuffer encoded, SpanBytesDecoder decoder, Callback<Void> callback, Executor executor)
LikeacceptSpans(byte[], BytesDecoder, Callback)
, except using a byte buffer.static Collector.Builder
newBuilder(Class<?> loggingClass)
Needed to scope this to the correct logging category
-
Method Details
-
newBuilder
Needed to scope this to the correct logging category -
accept
-
accept
- Parameters:
executor
- the executor used to enqueue the storage request.Calls to get the storage component could be blocking. This ensures requests that block callers (such as http or gRPC) do not add additional load during such events.
-
acceptSpans
public void acceptSpans(ByteBuffer encoded, SpanBytesDecoder decoder, Callback<Void> callback, Executor executor)LikeacceptSpans(byte[], BytesDecoder, Callback)
, except using a byte buffer. -
acceptSpans
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
. Do not call any other metrics callbacks as those are handled internal to this method.- Parameters:
serialized
- not empty message
-
acceptSpans
public void acceptSpans(byte[] serializedSpans, BytesDecoder<Span> decoder, Callback<Void> callback)Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
. Do not call any other metrics callbacks as those are handled internal to this method.- Parameters:
serializedSpans
- not empty message
-