Package com.newrelic.api.agent
Annotation Type Trace
-
@Target(METHOD) @Retention(RUNTIME) public @interface Trace
If you annotate a method with the Trace annotation it will be automatically timed by the New Relic agent with the following measurements:- call count
- calls per minute
- total call time
- standard deviation call time
- min call time
- max call time
- See Also:
TracedMethod
-
-
Field Summary
Fields Modifier and Type Fields Description static java.lang.String
NULL
Deprecated.No replacement.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
async
Tells the agent that this method is asynchronous and that it should be traced if the method is linked to an existing transaction.boolean
dispatcher
If true, this method will be considered the start of a transaction.boolean
excludeFromTransactionTrace
Excludes this traced method from transaction traces.boolean
leaf
A leaf tracer will not have any child tracers.java.lang.String
metricName
Sets the metric name for this tracer.boolean
nameTransaction
Names the current transaction using this tracer's metric name.java.lang.String[]
rollupMetricName
Specifies one or more rollup metrics names.boolean
skipTransactionTrace
Deprecated.Use (excludeFromTransactionTrace()
) instead.java.lang.String
tracerFactoryName
Deprecated.Do not use.
-
-
-
Element Detail
-
metricName
java.lang.String metricName
Sets the metric name for this tracer. If unspecified, the class / method name will be used. When using both nameTransaction and metricName, nameTransaction will take precedence and the transaction will use the name from the underlying tracer (typically class/method), rather than the custom name set by metricName. It is recommended to use one or the other depending on naming preferences.- Returns:
- The metric name for this tracer.
- Since:
- 1.3.0
- Default:
- ""
-
-
-
rollupMetricName
java.lang.String[] rollupMetricName
Specifies one or more rollup metrics names. When the tracer finishes, an unscoped metric (a metric which is not scoped to a specific transaction) will be recorded with the given metric name. This is useful when you want to record a summary value across multiple methods or transaction names.- Returns:
- One or more rollup metric names.
- Since:
- 3.5.0
- Default:
- {""}
-
-
-
dispatcher
boolean dispatcher
If true, this method will be considered the start of a transaction. When this method is invoked within the context of an existing transaction this has no effect. If false and this method is invoked outside a transaction, then this tracer will not be reported.- Returns:
- True if this method should start a transaction if one has not already been started.
- Since:
- 1.3.0
- Default:
- false
-
-
-
nameTransaction
boolean nameTransaction
Names the current transaction using this tracer's metric name. When using both nameTransaction and metricName, nameTransaction will take precedence and the transaction will use the name from the underlying tracer (typically class/method), rather than the custom name set by metricName. It is recommended to use one or the other depending on naming preferences.- Returns:
- True if this traced method should be used to name the transaction, else false.
- Since:
- 3.1.0
- Default:
- false
-
-
-
skipTransactionTrace
boolean skipTransactionTrace
Deprecated.Use (excludeFromTransactionTrace()
) instead.Ignores the entire current transaction.- Returns:
- True if this transaction should be ignored, else false.
- Since:
- 2.21.0
- Default:
- false
-
-
-
leaf
boolean leaf
A leaf tracer will not have any child tracers. This is useful when all time should be attributed to the tracer even if other trace points are encountered during its execution. For example, database tracers often act as leaf so that all time is attributed to database activity even if instrumented external calls are made. If a leaf tracer does not participate in transaction traces (excludeFromTransactionTrace()
) the agent can create a tracer with lower overhead.- Returns:
- True if this traced method should be a leaf, else false.
- Since:
- 3.1.0
- Default:
- false
-
-