-
@Retention(RUNTIME) @Target(METHOD) public @interface Traced
Annotating a method with@Tracedcreates aSpanas the child of the currently active span or transaction (ElasticApm.currentSpan()).When there is no current span, a
Transactionwill be created instead.Use this annotation over
CaptureSpanorCaptureTransactionif a method can both be an entry point (aTransaction) or a unit of work within a transaction (aSpan).Note: it is required to configure the
application_packages, otherwise this annotation will be ignored.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringactionSets the action of the captured span, used to group similar spans together, for example: `query`.StringsubtypeSets the subtype of the captured span, used to group similar spans together, for example: `mysql`.StringtypeSets the general type of the captured span or transaction, used to group similar spans together, for example: `db`.StringvalueThe name of theSpanorTransaction.
-
-
-
Element Detail
-
value
String value
- Default:
- ""
-
-
-
type
String type
Sets the general type of the captured span or transaction, used to group similar spans together, for example: `db`. Though there are no naming restrictions for the general types, the following are standardized across all Elastic APM agents: `app`, `db`, `cache`, `template`, and `ext`.
Defaults to
requestfor transactions andappfor spans- Default:
- ""
-
-
-
subtype
String subtype
Sets the subtype of the captured span, used to group similar spans together, for example: `mysql`.
NOTE: has no effect when a transaction is created
- Default:
- ""
-
-
-
action
String action
Sets the action of the captured span, used to group similar spans together, for example: `query`.
NOTE: has no effect when a transaction is created
- Default:
- ""
-
-