Annotation Type Traced
@Traced creates a Span as the child of the currently active span or transaction
(ElasticApm.currentSpan()).
When there is no current span,
a Transaction will be created instead.
Use this annotation over CaptureSpan or CaptureTransaction if a method can both be an entry point (a Transaction)
or a unit of work within a transaction (a Span).
Note: it is required to configure the application_packages, otherwise this annotation will be ignored.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSets the action of the captured span, used to group similar spans together, for example: `query`.booleanMakes the captured span captured as an "exit span".booleanBy default, spans are discardable.Sets the subtype of the captured span, used to group similar spans together, for example: `mysql`.Sets the general type of the captured span or transaction, used to group similar spans together, for example: `db`.The name of theSpanorTransaction.
-
Element Details
-
value
String value- Default:
- ""
-
type
String typeSets 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 subtypeSets 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 actionSets 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:
- ""
-
discardable
boolean discardableBy default, spans are discardable. This attribute is only relevant if the annotated method results with a span. In some cases, spans may be discarded, for example if
span_min_durationconfig option is set and the span does not exceed the configured threshold. Set this attribute tofalseto make the current span non-discardable.NOTE: making a span non-discardable implicitly makes the entire stack of active spans non-discardable as well. Child spans can still be discarded.
- Default:
- true
-
asExit
boolean asExitMakes the captured span captured as an "exit span".
NOTE: has no effect when a transaction is created
- Default:
- false
-