thundra-agent-trace-instrument-metadatagen
module should be optionally in the dependencies/classpath during compilation. Otherwise, Thundra decompiles the class files on demand to geenerate the source code on the file and as you guess, it may be not be exactly the same as the original source code. thundra-agent-trace-instrument-metadatagen
module includes Thundra Java annotation processor and generates metadata (source code, line mappings, etc ...) about classes to be used for tracing at runtime.@Traced
annotation with the traceLineByLine
attribute true
must be put onto classes/methods to be debugged.@Traced
annotation – they must be marked with this annotation. The class level @Traced
annotation is mandatory; if not marked with the annotation, classes won’t be checked or debugged. Additionally, methods can be marked with this annotation as well.@Traced
annotation, you need to add the thundra-agent-api-trace
module into your dependencies:get
method is debugged automatically.getFromCache
and getFromRepository
methods are debugged in addition to the get
method.@Traced
annotation by setting the justMarker
property and annotate the desired method with the method level @Traced
annotation.get
method is debugged because the class level @Traced
annotation is marked and only the get
method is annotated.traceLineByLine
attribute of the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG
environment variable must be configured for the packages, classes or the methods to be traced line by line.THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG...
format, meaning a name must start with the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG
. For example, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG
, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG1
, THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG2
, etc ... So multiple definitions can be defined through multiple environment variables starting with THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG
environment variable name.<class-def>.<method-def>[...]
format, The asterisk character (*
) in the <class-def>
and <method-def>
is supported. For example:get
method in the com.mycompany.UserService
class: com.mycompany.UserService.get
validate
in the class com.mycompany.UserService
: com.mycompany.UserService.validate*
com.mycompany.UserService
class: com.mycompany.UserService.*
com.mycompany
package: com.mycompany.*.*
UserService
class over environment variables, the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG
environment variable can be specified as com.mycompany.UserService.*[traceLineByLine=true].
methodModifiers
attribute which can be configured as a hexadecimal format definition of modifiers from the java.lang.reflect.Modifier
class, as shown below:0x00000001
means public methods.0x00000002
means private methods.0x00000004
means protected methods.0x00000008
means static methods.0x00000001 | 0x00000002
means private or public methods. As shown here, multiple modifiers can be combined with the | character.0x70000000
means any method.|
character and this means logical OR
.UserService
class over environment variables, the THUNDRA_AGENT_TRACE_INSTRUMENT_TRACEABLECONFIG
environment variable can be specified as com.mycompany.UserService.*[traceLineByLine=true,methodModifiers=0x00000001|0x00000002]