public class SpanBuilder extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SpanBuilder.Augmenter
A callback used to augment newly constructed Spans
|
| Constructor and Description |
|---|
SpanBuilder() |
| Modifier and Type | Method and Description |
|---|---|
SpanBuilder |
createChild()
Create a child of this span
|
static SpanBuilder |
createChild(long traceId,
long parentSpanId)
Create a builder for a span which is a child of another span.
|
static SpanBuilder |
createRoot()
Create a builder for a root span.
|
SpanBuilder |
exception(Throwable e)
Add exception information to the metadata.
|
Span |
finishSpan(String service)
Finish building the span.
|
SpanBuilder |
meta(String key,
String value)
Add meta information.
|
SpanBuilder |
metric(String key,
Number value)
Add a metric.
|
public SpanBuilder metric(String key, Number value)
key - The name of the metricvalue - The value of the metricpublic SpanBuilder meta(String key, String value)
key - The name of the meta informationvalue - The value of the meta informationpublic SpanBuilder exception(Throwable e)
e - The exception to addpublic SpanBuilder createChild()
public static SpanBuilder createRoot()
public static SpanBuilder createChild(long traceId, long parentSpanId)
traceId - The id of the traceparentSpanId - The id of the parent spanCopyright © 2017. All rights reserved.