public abstract class FlushingSpanCollector extends Object implements SpanCollector, Flushable, Closeable
| Modifier | Constructor and Description |
|---|---|
protected |
FlushingSpanCollector(SpanCollectorMetricsHandler metrics,
int flushInterval) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultAnnotation(String key,
String value)
Adds a fixed annotation that will be added to every span that is submitted to this collector.
|
void |
close()
Requests a cease of delivery.
|
void |
collect(Span span)
Queues the span for collection, or drops it if the queue is full.
|
void |
flush()
Calling this will flush any pending spans to the transport on the current thread.
|
protected abstract void |
reportSpans(List<Span> drained)
Reports a list of spans over the current transport.
|
protected FlushingSpanCollector(SpanCollectorMetricsHandler metrics, int flushInterval)
flushInterval - in seconds. 0 implies spans are {@link #flush() flushed externally.public void collect(Span span)
collect in interface SpanCollectorspan - Span, should not be null.public void flush()
protected abstract void reportSpans(List<Span> drained) throws IOException
IOException - (or RuntimeException) when thrown, drop metrics will increment accordinglypublic void addDefaultAnnotation(String key, String value)
SpanCollectoraddDefaultAnnotation in interface SpanCollectorkey - Annotation name/key. Should not be empty or null.value - Annotation value. Should not be null.public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2016. All rights reserved.