Package brave.opentracing
Class BraveSpan
- java.lang.Object
-
- brave.opentracing.BraveSpan
-
- All Implemented Interfaces:
io.opentracing.Span
public final class BraveSpan extends Object implements io.opentracing.Span
Holds the Span used by the underlying Tracer.This type also includes hooks to integrate with the underlying Tracer. Ex you can access the underlying span with
unwrap()Operations to add data to the span are ignored once
finish()orfinish(long)are called.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BraveSpanContextcontext()booleanequals(Object o)voidfinish()voidfinish(long finishMicros)StringgetBaggageItem(String key)Returns null unlessBaggagePropagationis in useinthashCode()BraveSpanlog(long timestampMicroseconds, String event)BraveSpanlog(long timestampMicroseconds, Map<String,?> fields)BraveSpanlog(String event)BraveSpanlog(Map<String,?> fields)BraveSpansetBaggageItem(String key, String value)This is a NOOP unlessBaggagePropagationis in useBraveSpansetOperationName(String operationName)<T> BraveSpansetTag(io.opentracing.tag.Tag<T> tag, T value)BraveSpansetTag(String key, boolean value)BraveSpansetTag(String key, Number value)Note:If the key is Tags.SAMPLING_PRIORITY and the value is zero, the current span will be abandoned and future references to thecontext()will be unsampled.BraveSpansetTag(String key, String value)StringtoString()brave.Spanunwrap()Returns wrapped Span
-
-
-
Method Detail
-
unwrap
public final brave.Span unwrap()
Returns wrapped Span
-
context
public BraveSpanContext context()
- Specified by:
contextin interfaceio.opentracing.Span
-
setTag
public BraveSpan setTag(String key, String value)
- Specified by:
setTagin interfaceio.opentracing.Span
-
setTag
public BraveSpan setTag(String key, boolean value)
- Specified by:
setTagin interfaceio.opentracing.Span
-
setTag
public BraveSpan setTag(String key, Number value)
Note:If the key is Tags.SAMPLING_PRIORITY and the value is zero, the current span will be abandoned and future references to thecontext()will be unsampled. This does not affect the active span, nor does it affect any equivalent instances of this object. This is a best efforts means to handle late sampling decisions.- Specified by:
setTagin interfaceio.opentracing.Span
-
setTag
public <T> BraveSpan setTag(io.opentracing.tag.Tag<T> tag, T value)
- Specified by:
setTagin interfaceio.opentracing.Span
-
log
public BraveSpan log(long timestampMicroseconds, Map<String,?> fields)
- Specified by:
login interfaceio.opentracing.Span
-
log
public BraveSpan log(long timestampMicroseconds, String event)
- Specified by:
login interfaceio.opentracing.Span
-
setBaggageItem
public BraveSpan setBaggageItem(String key, String value)
This is a NOOP unlessBaggagePropagationis in use- Specified by:
setBaggageItemin interfaceio.opentracing.Span
-
getBaggageItem
public String getBaggageItem(String key)
Returns null unlessBaggagePropagationis in use- Specified by:
getBaggageItemin interfaceio.opentracing.Span
-
setOperationName
public BraveSpan setOperationName(String operationName)
- Specified by:
setOperationNamein interfaceio.opentracing.Span
-
finish
public void finish()
- Specified by:
finishin interfaceio.opentracing.Span
-
finish
public void finish(long finishMicros)
- Specified by:
finishin interfaceio.opentracing.Span
-
-