Package com.newrelic.api.agent
Interface TracedMethod
-
- All Superinterfaces:
AttributeHolder
public interface TracedMethod extends AttributeHolder
Represents a single instance of the timing mechanism associated with a method that is instrumented using theTrace
annotation.- See Also:
Agent.getTracedMethod()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addOutboundRequestHeaders(OutboundHeaders outboundHeaders)
Deprecated.Instead, use the Distributed Tracing APITransaction.insertDistributedTraceHeaders(Headers)
to create a distributed tracing payload.void
addRollupMetricName(java.lang.String... metricNameParts)
Metric names added here will be reported as roll-up metrics.java.lang.String
getMetricName()
Returns the traced method metric name.void
reportAsExternal(ExternalParameters externalParameters)
Used to report this traced method as an HTTP external call, datastore external call, or general external call.void
setMetricName(java.lang.String... metricNameParts)
Sets the traced method metric name by concatenating all given metricNameParts with a '/' separating each part.-
Methods inherited from interface com.newrelic.api.agent.AttributeHolder
addCustomAttribute, addCustomAttribute, addCustomAttribute, addCustomAttributes
-
-
-
-
Method Detail
-
getMetricName
java.lang.String getMetricName()
Returns the traced method metric name.- Returns:
- The metric named used for this traced method.
- Since:
- 3.9.0
-
setMetricName
void setMetricName(java.lang.String... metricNameParts)
Sets the traced method metric name by concatenating all given metricNameParts with a '/' separating each part.- Parameters:
metricNameParts
- The segments of the metric name. These values will be concatenated together separated by a `/` char.- Since:
- 3.9.0
-
addRollupMetricName
void addRollupMetricName(java.lang.String... metricNameParts)
Metric names added here will be reported as roll-up metrics. A roll-up metric is an extra unscoped metric (a metric which is not scoped to a specific transaction) that is reported in addition to the normal metric recorded for a traced method. An example of how the agent uses a roll-up metric is the OtherTransaction/all metric. Each background transaction records data to its transaction specific metric and to the OtherTransaction/all roll-up metric which represents all background transactions.- Parameters:
metricNameParts
- The segments of the rollup metric name. These values will be concatenated together separated by a `/` char.- Since:
- 3.9.0
-
reportAsExternal
void reportAsExternal(ExternalParameters externalParameters)
Used to report this traced method as an HTTP external call, datastore external call, or general external call. Depending on the information available to report, use one of the respective builders for the following objects:GenericParameters
,HttpParameters
,DatastoreParameters
,MessageProduceParameters
,MessageConsumeParameters
. Note: If you are performing an external HTTP call, be sure to calladdOutboundRequestHeaders(OutboundHeaders)
prior to the request being sent.- Parameters:
externalParameters
- The appropriate input parameters depending on the type of external call. Use one of the respective builders for the following objects:GenericParameters
,HttpParameters
,DatastoreParameters
,MessageProduceParameters
,MessageConsumeParameters
.- Since:
- 3.36.0
-
addOutboundRequestHeaders
@Deprecated void addOutboundRequestHeaders(OutboundHeaders outboundHeaders)
Deprecated.Instead, use the Distributed Tracing APITransaction.insertDistributedTraceHeaders(Headers)
to create a distributed tracing payload. However, note that theinsertDistributedTraceHeaders
API only adds distributed tracing headers and does not add legacy CAT headers. If CAT must be supported then instead use this deprecated API.To be called when performing an outbound external request using HTTP or JMS. This method must be called before any headers are written to the output stream. This method is generally used in conjunction with reportAsExternal.- Parameters:
outboundHeaders
- The headers that will be written to the output stream for the external request. This also determines if the external call is HTTP or JMS.- Since:
- 3.36.0
-
-