Class Span
- java.lang.Object
-
- co.elastic.apm.agent.impl.transaction.AbstractSpan<Span>
-
- co.elastic.apm.agent.impl.transaction.Span
-
- All Implemented Interfaces:
Recyclable
public class Span extends AbstractSpan<Span> implements Recyclable
-
-
Field Summary
Fields Modifier and Type Field Description static longMAX_LOG_INTERVAL_MICRO_SECS-
Fields inherited from class co.elastic.apm.agent.impl.transaction.AbstractSpan
collectBreakdownMetrics, duration, finished, MS_IN_MICROS, name, PRIO_DEFAULT, PRIO_HIGH_LEVEL_FRAMEWORK, PRIO_LOW_LEVEL_FRAMEWORK, PRIO_METHOD_SIGNATURE, PRIO_USER_SUPPLIED, references, traceContext, tracer
-
-
Constructor Summary
Constructors Constructor Description Span(ElasticApmTracer tracer)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidafterEnd()voidbeforeEnd(long epochMicros)voiddecrementReferences()java.lang.StringgetAction()SpanContextgetContext()Any other arbitrary data captured by the agent, optionally provided by the userAbstractSpan<?>getParent()java.util.List<StackFrame>getStackFrames()java.lang.ThrowablegetStacktrace()java.lang.StringgetSubtype()TransactiongetTransaction()java.lang.StringgetType()voidincrementReferences()protected voidonAfterStart()Called after the span has been started and its parent references are setprotected voidrecycle()voidresetState()resets pooled object state so it can be reusedvoidsetNonDiscardable()If a span is non-discardable, all the spans leading up to it are non-discardable as wellvoidsetStackTrace(java.util.List<StackFrame> stackTrace)voidsetType(java.lang.String type, java.lang.String subtype, java.lang.String action)Deprecated.<T> Spanstart(TraceContext.ChildContextCreator<T> childContextCreator, T parentContext, long epochMicros)protected Spanthiz()java.lang.StringtoString()SpanwithAction(java.lang.String action)Action related to this span (eg: 'query', 'render' etc)SpanwithStacktrace(java.lang.Throwable stacktrace)SpanwithSubtype(java.lang.String subtype)Sets the span's subtype, related to the (eg: 'mysql', 'postgresql', 'jsf' etc)SpanwithType(java.lang.String type)Keywords of specific relevance in the span's domain (eg: 'db', 'template', 'ext', etc)-
Methods inherited from class co.elastic.apm.agent.impl.transaction.AbstractSpan
activate, activateInScope, addLabel, addLabel, addLabel, appendToName, appendToName, asExit, captureException, captureException, captureExceptionAndGetErrorId, createExitSpan, createSpan, createSpan, deactivate, end, end, endExceptionally, getAndOverrideName, getAndOverrideName, getChildIds, getDuration, getDurationMs, getNameAsString, getNameForSerialization, getOutcome, getReferenceCount, getSelfDuration, getTimestamp, getTraceContext, hasCapturedExceptions, isChildOf, isDiscardable, isDiscarded, isExit, isFinished, isReferenced, isSampled, outcomeNotSet, propagateTraceContext, propagateTraceContext, requestDiscarding, setStartTimestamp, setStartTimestampNow, withChildIds, withName, withName, withName, withOutcome, withUserOutcome
-
-
-
-
Constructor Detail
-
Span
public Span(ElasticApmTracer tracer)
-
-
Method Detail
-
setNonDiscardable
public void setNonDiscardable()
If a span is non-discardable, all the spans leading up to it are non-discardable as well- Overrides:
setNonDiscardablein classAbstractSpan<Span>
-
start
public <T> Span start(TraceContext.ChildContextCreator<T> childContextCreator, T parentContext, long epochMicros)
-
onAfterStart
protected void onAfterStart()
Description copied from class:AbstractSpanCalled after the span has been started and its parent references are set- Overrides:
onAfterStartin classAbstractSpan<Span>
-
getContext
public SpanContext getContext()
Any other arbitrary data captured by the agent, optionally provided by the user- Specified by:
getContextin classAbstractSpan<Span>
-
withType
public Span withType(@Nullable java.lang.String type)
Keywords of specific relevance in the span's domain (eg: 'db', 'template', 'ext', etc)
-
withSubtype
public Span withSubtype(@Nullable java.lang.String subtype)
Sets the span's subtype, related to the (eg: 'mysql', 'postgresql', 'jsf' etc)
-
withAction
public Span withAction(@Nullable java.lang.String action)
Action related to this span (eg: 'query', 'render' etc)
-
setType
@Deprecated public void setType(@Nullable java.lang.String type, @Nullable java.lang.String subtype, @Nullable java.lang.String action)Deprecated.Sets span.type, span.subtype and span.action. If no subtype and action are provided, assumes the legacy usage of hierarchical typing system and attempts to split the type by dots to discover subtype and action. TODO: remove in 2.0 - no need for that once we decide to drop support for old agent usages
-
getStacktrace
@Nullable public java.lang.Throwable getStacktrace()
-
getType
@Nullable public java.lang.String getType()
-
getSubtype
@Nullable public java.lang.String getSubtype()
-
getAction
@Nullable public java.lang.String getAction()
-
beforeEnd
public void beforeEnd(long epochMicros)
- Specified by:
beforeEndin classAbstractSpan<Span>
-
afterEnd
protected void afterEnd()
- Specified by:
afterEndin classAbstractSpan<Span>
-
resetState
public void resetState()
Description copied from interface:Recyclableresets pooled object state so it can be reused- Specified by:
resetStatein interfaceRecyclable- Overrides:
resetStatein classAbstractSpan<Span>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
withStacktrace
public Span withStacktrace(java.lang.Throwable stacktrace)
-
incrementReferences
public void incrementReferences()
- Overrides:
incrementReferencesin classAbstractSpan<Span>
-
decrementReferences
public void decrementReferences()
- Overrides:
decrementReferencesin classAbstractSpan<Span>
-
recycle
protected void recycle()
- Specified by:
recyclein classAbstractSpan<Span>
-
thiz
protected Span thiz()
- Specified by:
thizin classAbstractSpan<Span>
-
setStackTrace
public void setStackTrace(java.util.List<StackFrame> stackTrace)
-
getStackFrames
@Nullable public java.util.List<StackFrame> getStackFrames()
-
getTransaction
@Nullable public Transaction getTransaction()
- Specified by:
getTransactionin classAbstractSpan<Span>
-
getParent
@Nullable public AbstractSpan<?> getParent()
-
-