SpanBuilderFactory.NoopSpanBuilder
public static class SpanBuilderFactory.SpanBuilder extends Object
Some properties are already initialised to defaults, but you may have to provide spanName and serviceName.
If traceId or spanId are not configured new random IDs will be generated upon calling build()
.
Spans are sampled on build()
, based on the implementation of the configured TraceSampler
.
Constructor | Description |
---|---|
SpanBuilder(SpanPostProcessor processor,
io.honeycomb.libhoney.transport.batch.ClockProvider clock,
TraceIdProvider idProvider,
TraceSampler<? super String> traceSampler) |
Modifier and Type | Method | Description |
---|---|---|
SpanBuilderFactory.SpanBuilder |
addField(String key,
Object value) |
|
SpanBuilderFactory.SpanBuilder |
addFields(Map<String,?> fieldsToAdd) |
|
Span |
build() |
Spans returned by this method are subject to sampling based on their
traceId . |
io.honeycomb.libhoney.transport.batch.ClockProvider |
getClock() |
|
Map<String,Object> |
getFields() |
|
PropagationContext |
getParentContext() |
|
SpanPostProcessor |
getProcessor() |
|
String |
getServiceName() |
|
String |
getSpanId() |
|
String |
getSpanName() |
|
Long |
getStartTime() |
|
Long |
getTimestamp() |
|
SpanBuilderFactory.SpanBuilder |
setParentContext(PropagationContext parentContext) |
|
SpanBuilderFactory.SpanBuilder |
setServiceName(String serviceName) |
|
SpanBuilderFactory.SpanBuilder |
setSpanId(String spanId) |
|
SpanBuilderFactory.SpanBuilder |
setSpanName(String spanName) |
|
SpanBuilderFactory.SpanBuilder |
setTimes(long newTimestamp,
long newStartTime) |
public SpanBuilder(SpanPostProcessor processor, io.honeycomb.libhoney.transport.batch.ClockProvider clock, TraceIdProvider idProvider, TraceSampler<? super String> traceSampler)
public SpanBuilderFactory.SpanBuilder setSpanName(String spanName)
public SpanBuilderFactory.SpanBuilder setServiceName(String serviceName)
public SpanBuilderFactory.SpanBuilder setParentContext(PropagationContext parentContext)
public SpanBuilderFactory.SpanBuilder addField(String key, Object value)
public SpanBuilderFactory.SpanBuilder addFields(Map<String,?> fieldsToAdd)
public SpanBuilderFactory.SpanBuilder setTimes(long newTimestamp, long newStartTime)
public SpanBuilderFactory.SpanBuilder setSpanId(String spanId)
public String getServiceName()
public String getSpanName()
public PropagationContext getParentContext()
public SpanPostProcessor getProcessor()
public Long getTimestamp()
public Long getStartTime()
public String getSpanId()
public io.honeycomb.libhoney.transport.batch.ClockProvider getClock()
public Span build()
traceId
. If the global sampler
decides the trace is not to be sampled then it will return a "noop" Span (see Span.isNoop()
.
If the SpanPostProcessor
has been configured with a "sampling hook", then for all Spans on a sampled
trace, another sampling decision is taken when they are closed. In other words,
the Spans are passed to the sampling hook just before they are about to be sent.
IllegalArgumentException
- if required attributes are not set.Copyright © 2019–2020 Honeycomb. All rights reserved.