public abstract class AbstractTracer extends java.lang.Object implements Tracer, com.newrelic.api.agent.AttributeHolder
InvocationHandler.invoke(Object, Method, Object[])| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ATTRIBUTE_TYPE |
| Constructor and Description |
|---|
AbstractTracer(Transaction transaction)
Create a tracer on the current thread.
|
AbstractTracer(TransactionActivity txa,
AttributeValidator attributeValidator)
Create a tracer on the current thread.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCustomAttribute(java.lang.String key,
boolean value) |
void |
addCustomAttribute(java.lang.String key,
java.lang.Number value) |
void |
addCustomAttribute(java.lang.String key,
java.lang.String value) |
void |
addCustomAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes) |
void |
addExclusiveRollupMetricName(java.lang.String... metricNameParts) |
void |
addOutboundRequestHeaders(com.newrelic.api.agent.OutboundHeaders outboundHeaders) |
void |
addRollupMetricName(java.lang.String... metricNameParts) |
void |
excludeLeaf() |
java.lang.Object |
getAgentAttribute(java.lang.String key)
Returns the specific object for the input key in the map of attributes used to store extra information about the
invocation (Like the sql statement for a sql tracer).
|
java.util.Set<java.lang.String> |
getAgentAttributeNamesForSpans()
Returns the set of agent attribute names that are marked to be added to span events.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAgentAttributes()
A map of attributes used to store extra information about the invocation (Like the sql statement for a sql
tracer).
|
abstract ClassMethodSignature |
getClassMethodSignature() |
java.lang.Object |
getCustomAttribute(java.lang.String key) |
java.util.Map<java.lang.String,java.lang.Object> |
getCustomAttributes()
A map of attributes the customer has added to the tracer
|
java.lang.Throwable |
getException()
Returns the exception, if any, that was noticed by the API or thrown by the tracer.
|
protected java.util.Set<java.lang.String> |
getExclusiveRollupMetricNames() |
com.newrelic.api.agent.ExternalParameters |
getExternalParameters() |
protected java.lang.Object |
getInvocationTarget() |
com.newrelic.agent.bridge.TracedMethod |
getParentTracedMethod() |
static Tracer |
getParentTracerWithSpan(Tracer tracer) |
protected java.util.Set<java.lang.String> |
getRollupMetricNames() |
long |
getStartTimeInMillis() |
Transaction |
getTransaction()
Get the transaction that currently owns the activity that owns this tracer.
|
TransactionActivity |
getTransactionActivity()
Get the transaction activity that owns this tracer.
|
java.lang.Object |
invoke(java.lang.Object methodName,
java.lang.reflect.Method method,
java.lang.Object[] args) |
boolean |
isAsync() |
boolean |
isChildHasStackTrace()
True means a child has taken a stack trace and therefore this tracer should not take one.
|
boolean |
isLeaf() |
boolean |
isTrackCallbackRunnable() |
void |
markFinishTime() |
void |
nameTransaction(com.newrelic.agent.bridge.TransactionNamePriority priority) |
void |
readInboundResponseHeaders(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders) |
void |
removeAgentAttribute(java.lang.String key)
Remove attribute.
|
void |
reportAsExternal(com.newrelic.api.agent.ExternalParameters externalParameters) |
void |
reportAsExternal(com.newrelic.agent.bridge.external.ExternalParameters externalParameters) |
void |
setAgentAttribute(java.lang.String key,
java.lang.Object value)
Add some extra information to the invocation (Like the sql statement for a sql tracer).
|
void |
setAgentAttribute(java.lang.String key,
java.lang.Object value,
boolean addToSpan)
Add some extra information to the invocation (Like the sql statement for a sql tracer).
|
void |
setAttribute(java.lang.String key,
java.lang.Object value,
boolean checkLimits,
boolean isCustom,
boolean addAgentAttrToSpan) |
void |
setCustomMetricPrefix(java.lang.String prefix) |
void |
setNoticedError(java.lang.Throwable throwable)
Sets an error that was identified by the public API.
|
void |
setRollupMetricNames(java.lang.String... metricNames) |
void |
setThrownException(java.lang.Throwable throwable)
Captures the exception that the was thrown during the tracer's execution.
|
void |
setTrackCallbackRunnable(boolean shouldTrack) |
void |
setTrackChildThreads(boolean shouldTrack) |
boolean |
trackChildThreads() |
boolean |
wasExceptionSetByAPI()
Returns true if the exception was set by
ErrorTracer.setNoticedError(Throwable) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchildTracerFinished, getChildCount, getEndTime, getEndTimeInMilliseconds, getExclusiveDuration, getGuid, getMetricName, getParentTracer, getRunningDurationInNanos, getStartTime, getStartTimeInMilliseconds, getTransactionSegment, getTransactionSegmentName, getTransactionSegmentUri, isParent, isTransactionSegment, removeTransactionSegment, setParentTracergetDuration, getDurationInMillisecondsprotected static final java.lang.String ATTRIBUTE_TYPE
public AbstractTracer(Transaction transaction)
transaction - the transaction that owns the activity on the current thread. Must not be null.public AbstractTracer(TransactionActivity txa, AttributeValidator attributeValidator)
txa - the activity for the current thread. The value is allowed to be null.public final Transaction getTransaction()
public final TransactionActivity getTransactionActivity()
getTransactionActivity in interface Tracerprotected java.lang.Object getInvocationTarget()
public final java.lang.Object invoke(java.lang.Object methodName,
java.lang.reflect.Method method,
java.lang.Object[] args)
invoke in interface java.lang.reflect.InvocationHandlerpublic abstract ClassMethodSignature getClassMethodSignature()
getClassMethodSignature in interface Tracerpublic boolean isChildHasStackTrace()
TracerisChildHasStackTrace in interface Tracerpublic void nameTransaction(com.newrelic.agent.bridge.TransactionNamePriority priority)
public com.newrelic.agent.bridge.TracedMethod getParentTracedMethod()
public void excludeLeaf()
protected java.util.Set<java.lang.String> getRollupMetricNames()
protected java.util.Set<java.lang.String> getExclusiveRollupMetricNames()
public void addRollupMetricName(java.lang.String... metricNameParts)
addRollupMetricName in interface com.newrelic.api.agent.TracedMethodpublic void setRollupMetricNames(java.lang.String... metricNames)
public void addExclusiveRollupMetricName(java.lang.String... metricNameParts)
public void setCustomMetricPrefix(java.lang.String prefix)
public void setTrackChildThreads(boolean shouldTrack)
public boolean trackChildThreads()
public void setTrackCallbackRunnable(boolean shouldTrack)
public boolean isTrackCallbackRunnable()
public void addOutboundRequestHeaders(com.newrelic.api.agent.OutboundHeaders outboundHeaders)
addOutboundRequestHeaders in interface com.newrelic.api.agent.TracedMethodpublic void readInboundResponseHeaders(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders)
public void reportAsExternal(com.newrelic.api.agent.ExternalParameters externalParameters)
reportAsExternal in interface com.newrelic.api.agent.TracedMethodpublic void reportAsExternal(com.newrelic.agent.bridge.external.ExternalParameters externalParameters)
public void markFinishTime()
markFinishTime in interface Tracerpublic long getStartTimeInMillis()
getStartTimeInMillis in interface Tracerpublic com.newrelic.api.agent.ExternalParameters getExternalParameters()
getExternalParameters in interface Tracerpublic void setNoticedError(java.lang.Throwable throwable)
ErrorTracersetNoticedError in interface ErrorTracerpublic void setThrownException(java.lang.Throwable throwable)
ErrorTracersetThrownException in interface ErrorTracerpublic boolean wasExceptionSetByAPI()
ErrorTracerErrorTracer.setNoticedError(Throwable)wasExceptionSetByAPI in interface ErrorTracerpublic java.lang.Throwable getException()
ErrorTracergetException in interface ErrorTracerpublic void addCustomAttribute(java.lang.String key,
java.lang.Number value)
addCustomAttribute in interface com.newrelic.api.agent.AttributeHolderpublic void addCustomAttribute(java.lang.String key,
java.lang.String value)
addCustomAttribute in interface com.newrelic.api.agent.AttributeHolderpublic void addCustomAttribute(java.lang.String key,
boolean value)
addCustomAttribute in interface com.newrelic.api.agent.AttributeHolderpublic void addCustomAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
addCustomAttributes in interface com.newrelic.api.agent.AttributeHolderpublic void setAttribute(java.lang.String key,
java.lang.Object value,
boolean checkLimits,
boolean isCustom,
boolean addAgentAttrToSpan)
public void setAgentAttribute(java.lang.String key,
java.lang.Object value)
TracersetAgentAttribute in interface Tracerpublic void setAgentAttribute(java.lang.String key,
java.lang.Object value,
boolean addToSpan)
TracersetAgentAttribute in interface Tracerpublic void removeAgentAttribute(java.lang.String key)
TracerremoveAgentAttribute in interface Tracerkey - attribute to removepublic java.lang.Object getAgentAttribute(java.lang.String key)
TracergetAgentAttribute in interface Tracerpublic java.util.Map<java.lang.String,java.lang.Object> getAgentAttributes()
TracergetAgentAttributes in interface Tracerpublic java.util.Map<java.lang.String,java.lang.Object> getCustomAttributes()
TracergetCustomAttributes in interface Tracerpublic java.util.Set<java.lang.String> getAgentAttributeNamesForSpans()
TracergetAgentAttributeNamesForSpans in interface Tracerpublic java.lang.Object getCustomAttribute(java.lang.String key)