Package co.elastic.apm.agent.impl.error
Class ErrorCapture
- java.lang.Object
-
- co.elastic.apm.agent.impl.error.ErrorCapture
-
- All Implemented Interfaces:
Recyclable
public class ErrorCapture extends java.lang.Object implements Recyclable
Data captured by an agent representing an event occurring in a monitored service
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classErrorCapture.TransactionInfo
-
Constructor Summary
Constructors Constructor Description ErrorCapture(ElasticApmTracer tracer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ErrorCaptureactivate()ErrorCaptureasChildOf(AbstractSpan<?> parent)Creates a reference to aTraceContextErrorCapturedeactivate()voidend()TransactionContextgetContext()Contextjava.lang.StringBuildergetCulprit()java.lang.ThrowablegetException()Information about the originally thrown error.longgetTimestamp()Recorded time of the error, UTC based and formatted as YYYY-MM-DDTHH:mm:ss.sssZ (Required)TraceContextgetTraceContext()ErrorCapture.TransactionInfogetTransactionInfo()voidrecycle()voidresetState()resets pooled object state so it can be reusedvoidsetException(java.lang.Throwable e)voidsetTransactionSampled(boolean transactionSampled)voidsetTransactionType(java.lang.String type)ErrorCapturewithTimestamp(long epochMs)
-
-
-
Constructor Detail
-
ErrorCapture
public ErrorCapture(ElasticApmTracer tracer)
-
-
Method Detail
-
getContext
public TransactionContext getContext()
ContextAny arbitrary contextual information regarding the event, captured by the agent, optionally provided by the user
-
getException
@Nullable public java.lang.Throwable getException()
Information about the originally thrown error.
-
getTimestamp
public long getTimestamp()
Recorded time of the error, UTC based and formatted as YYYY-MM-DDTHH:mm:ss.sssZ (Required)
-
withTimestamp
public ErrorCapture withTimestamp(long epochMs)
-
resetState
public void resetState()
Description copied from interface:Recyclableresets pooled object state so it can be reused- Specified by:
resetStatein interfaceRecyclable
-
recycle
public void recycle()
-
asChildOf
public ErrorCapture asChildOf(AbstractSpan<?> parent)
Creates a reference to aTraceContext- Parameters:
parent- parent trace context- Returns:
this, for chaining
-
getTraceContext
public TraceContext getTraceContext()
-
setException
public void setException(java.lang.Throwable e)
-
getCulprit
public java.lang.StringBuilder getCulprit()
-
activate
public ErrorCapture activate()
-
deactivate
public ErrorCapture deactivate()
-
getTransactionInfo
public ErrorCapture.TransactionInfo getTransactionInfo()
-
setTransactionSampled
public void setTransactionSampled(boolean transactionSampled)
-
setTransactionType
public void setTransactionType(@Nullable java.lang.String type)
-
end
public void end()
-
-