AutoCloseable
public class SendingSpan extends Span
SpanPostProcessor
, which adds the standard fields that are required for Honeycomb to recognise an Event as a
Span.
Close must only be called once, and subsequent invocations will be ignored.
If you need to construct Spans of this type, you can make use SpanBuilderFactory
.
Constructor | Description |
---|---|
SendingSpan(String spanName,
String serviceName,
String spanId,
Map<String,?> fields,
PropagationContext context,
SpanPostProcessor processor,
io.honeycomb.libhoney.transport.batch.ClockProvider clock,
int initialSampleRate) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
closeInternal() |
Closes the span by generating an Event using the configured
SpanPostProcessor , adding required fields,
applying the sampling hook, and, if sampled, sends it to Honeycomb. |
int |
getInitialSampleRate() |
Returns the initial sample rate.
|
protected SpanPostProcessor |
getProcessor() |
Getter for the processor, in case future development needs access to it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addField, addFields, addTraceField, addTraceFields, close, elapsedTimeMs, getDataset, getFields, getNoopInstance, getParentSpanId, getServiceName, getSpanId, getSpanName, getStartTime, getTimestamp, getTraceContext, getTraceFields, getTraceId, isNoop, markStart, markStart, toString
public SendingSpan(String spanName, String serviceName, String spanId, Map<String,?> fields, PropagationContext context, SpanPostProcessor processor, io.honeycomb.libhoney.transport.batch.ClockProvider clock, int initialSampleRate)
protected void closeInternal()
SpanPostProcessor
, adding required fields,
applying the sampling hook, and, if sampled, sends it to Honeycomb.
The event's sampling rate is set to the product of the initialSampleRate
and the sampling rate returned
by SpanPostProcessor.runSamplerHook(Span)
.
closeInternal
in class Span
public int getInitialSampleRate()
protected SpanPostProcessor getProcessor()
Copyright © 2019–2020 Honeycomb. All rights reserved.