public class SpanHelper extends Object
| 构造器和说明 |
|---|
SpanHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Span |
attachSpan(BigInteger traceId,
BigInteger spanId,
String name)
Attach to an existing span.
|
static com.google.common.base.Optional<Span> |
currentSpan() |
static Sampling |
getSampler() |
static void |
setSampler(Sampling sampler) |
static Span |
startSpan(BigInteger traceId,
BigInteger parentSpanId,
String name)
Starts a new span under the specified trace and parent spanId.
|
static Span |
startSpan(String name)
Starts a new span within a trace.
|
static Span |
startTrace(String name)
Starts a new trace.
|
public static Sampling getSampler()
public static void setSampler(Sampling sampler)
public static Span startTrace(String name)
name - Name to be given to the root span in the trace.public static Span startSpan(String name)
name - Name to be given to the span.public static Span attachSpan(BigInteger traceId, BigInteger spanId, String name)
traceId - ID of the trace of the span being attached.spanId - ID of the span being attached.name - Name for the span - useful for debugpublic static Span startSpan(BigInteger traceId, BigInteger parentSpanId, String name)
traceId - - the current traceIdparentSpanId - - the parent span, if availablename - - the name for this spanpublic static com.google.common.base.Optional<Span> currentSpan()
Copyright © 2019. All rights reserved.