Package fish.payara.opentracing.span
Class Span
- java.lang.Object
-
- fish.payara.notification.requesttracing.RequestTraceSpan
-
- fish.payara.opentracing.span.Span
-
- All Implemented Interfaces:
io.opentracing.Span
,Serializable
,Comparable<RequestTraceSpan>
public class Span extends RequestTraceSpan implements io.opentracing.Span
Implementation of the OpenTracing Span class. These Spans get recorded by the Request Tracing Service.- Author:
- Andrew Pielage
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fish.payara.notification.requesttracing.RequestTraceSpan
RequestTraceSpan.SpanContextRelationshipType, RequestTraceSpan.SpanReference
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.opentracing.SpanContext
context()
void
finish()
void
finish(long finishMicros)
String
getApplicationName()
Returns the name of the application that this Span was created from.String
getBaggageItem(String key)
io.opentracing.Span
log(long timestampMicroseconds, String logEvent)
io.opentracing.Span
log(long timestampMicroseconds, Map<String,?> map)
io.opentracing.Span
log(String logEvent)
io.opentracing.Span
log(Map<String,?> map)
io.opentracing.Span
setBaggageItem(String key, String value)
io.opentracing.Span
setOperationName(String operationName)
void
setStartTime(long startTimeMicros)
Sets the start time of the Span.<T> io.opentracing.Span
setTag(io.opentracing.tag.Tag<T> tag, T tagValue)
io.opentracing.Span
setTag(String tagName, boolean tagValue)
io.opentracing.Span
setTag(String tagName, Number tagValue)
io.opentracing.Span
setTag(String tagName, String tagValue)
-
Methods inherited from class fish.payara.notification.requesttracing.RequestTraceSpan
addSpanLog, addSpanReference, addSpanTag, addSpanTag, compareTo, getEventName, getEventType, getId, getSpanContext, getSpanDuration, getSpanReferences, getSpanTag, getSpanTags, getStartInstant, getTimeOccured, getTraceEndTime, getTraceId, setEventName, setEventType, setSpanDuration, setStartInstant, setTraceEndTime, setTraceId, toString
-
-
-
-
Constructor Detail
-
Span
public Span(String operationName, String applicationName)
Constructor that creates a RequestTraceSpan object and sets the application name that this Span was created from.- Parameters:
operationName
- The name of the spanapplicationName
- The name of the application that this Span was created from
-
-
Method Detail
-
getApplicationName
public String getApplicationName()
Returns the name of the application that this Span was created from.- Returns:
- The name of the application that this Span was created from.
-
context
public io.opentracing.SpanContext context()
- Specified by:
context
in interfaceio.opentracing.Span
-
setTag
public io.opentracing.Span setTag(String tagName, String tagValue)
- Specified by:
setTag
in interfaceio.opentracing.Span
-
setTag
public io.opentracing.Span setTag(String tagName, boolean tagValue)
- Specified by:
setTag
in interfaceio.opentracing.Span
-
setTag
public io.opentracing.Span setTag(String tagName, Number tagValue)
- Specified by:
setTag
in interfaceio.opentracing.Span
-
setTag
public <T> io.opentracing.Span setTag(io.opentracing.tag.Tag<T> tag, T tagValue)
- Specified by:
setTag
in interfaceio.opentracing.Span
-
log
public io.opentracing.Span log(Map<String,?> map)
- Specified by:
log
in interfaceio.opentracing.Span
-
log
public io.opentracing.Span log(long timestampMicroseconds, Map<String,?> map)
- Specified by:
log
in interfaceio.opentracing.Span
-
log
public io.opentracing.Span log(String logEvent)
- Specified by:
log
in interfaceio.opentracing.Span
-
log
public io.opentracing.Span log(long timestampMicroseconds, String logEvent)
- Specified by:
log
in interfaceio.opentracing.Span
-
setBaggageItem
public io.opentracing.Span setBaggageItem(String key, String value)
- Specified by:
setBaggageItem
in interfaceio.opentracing.Span
-
getBaggageItem
public String getBaggageItem(String key)
- Specified by:
getBaggageItem
in interfaceio.opentracing.Span
-
setOperationName
public io.opentracing.Span setOperationName(String operationName)
- Specified by:
setOperationName
in interfaceio.opentracing.Span
-
finish
public void finish()
- Specified by:
finish
in interfaceio.opentracing.Span
-
finish
public void finish(long finishMicros)
- Specified by:
finish
in interfaceio.opentracing.Span
-
setStartTime
public void setStartTime(long startTimeMicros)
Sets the start time of the Span.- Parameters:
startTimeMicros
- The start time of the Span in Microseconds
-
-