public class SpanBuilder extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
SpanBuilder.SpanContext
The context of an active Span builder.
|
| 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 |
error(boolean error) |
SpanBuilder |
exception(Throwable e)
Add exception information to the metadata.
|
SpanBuilder.SpanContext |
exportSpan() |
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 error(boolean error)
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 spanpublic Span finishSpan(String service)
service - The service valuepublic SpanBuilder.SpanContext exportSpan()
Copyright © 2017. All rights reserved.