Download the Thundra agent here
Start your Java application with the Thundra agent jar by -javaagent
VM argument.
java -javaagent:<path-to-thundra-agent> -jar <your-app-jar> ...
The following example shows how the application is configured with Dockerfile:
FROM openjdk:8RUN mkdir -p /appADD target/thundra-container-demo-0.1.0.jar /app/thundra-container-demo.jarADD thundra-agent-bootstrap.jar /app/thundra-agent-bootstrap.jarWORKDIR /appEXPOSE 8080ENTRYPOINT [ "java", "-javaagent:thundra-agent-bootstrap.jar", "-jar", "thundra-container-demo.jar" ]
Put thundra-config.yml
in your artifact, which is picked up from classpath automatically.
Set your Thundra API key.
Set your application name.
thundra:apiKey: <your-api-key>agent:application:name: <your-application-name>
As an example, the thundra-config.yml
can be put under the src/main/resources/
folder in the Maven project structure (a software project management tool) so the Thundra agent will be able to directly read its classpath.
The Thundra agent supports the following frameworks without any additional configuration needed:
Spring Web (4.x, 5.x)
Spring Boot (1.x, 2.x)
For other applications, the entry point for traces should be specified programmatically (by annotation) or declaratively (by YML configuration).
With @Traceable
annotation, you can specify the entry point (where the transaction starts) of the trace programmatically, as shown in the example below:
package com.mycompany;import io.thundra.agent.trace.instrument.config.Traceable;@Traceable(justMarker = true)public class MyAwesomeClass {....@Traceable(entryPoint = true,...)public void doSomething() {}....}
With the thundra.agent.trace.instrument.traceableConfig
property in the thundra-config.yml
, you can specify the entry point (where the transaction starts) of the trace declaratively, as shown in the example below:
thundra:apiKey: <your-api-key>agent:trace:instrument:traceableConfig: com.mycompany.MyAwesomeClass.doSomething[entryPoint=true]application:name: <your-application-name>