Thundra APM
Search…
Deployment Integrations
Powered By GitBook
Integration Options for Java SDK in Containers and VMs
    Download the Thundra agent here.
    Start your Java application with the Thundra agent jar by -javaagent VM argument.
1
java -javaagent:<path-to-thundra-agent> -jar <your-app-jar> ...
Copied!
    The following example shows how the application is configured with Dockerfile:
1
FROM openjdk:8
2
RUN mkdir -p /app
3
ADD target/thundra-container-demo-0.1.0.jar /app/thundra-container-demo.jar
4
ADD thundra-agent-bootstrap.jar /app/thundra-agent-bootstrap.jar
5
WORKDIR /app
6
EXPOSE 8080
7
ENTRYPOINT [ "java", "-javaagent:thundra-agent-bootstrap.jar", "-jar", "thundra-container-demo.jar" ]
Copied!
    Put thundra-config.yml in your artifact, which is picked up from classpath automatically.
      Set your Thundra API key.
      Set your application name.
1
thundra:
2
apiKey: <your-api-key>
3
agent:
4
application:
5
name: <your-application-name>
Copied!
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).

Programmatic Configuration

With @Traceable annotation, you can specify the entry point (where the transaction starts) of the trace programmatically, as shown in the example below:
1
package com.mycompany;
2
3
import io.thundra.agent.trace.instrument.config.Traceable;
4
5
@Traceable(
6
justMarker = true
7
)
8
public class MyAwesomeClass {
9
10
....
11
12
@Traceable(
13
entryPoint = true,
14
...
15
)
16
public void doSomething() {
17
18
}
19
20
....
21
22
}
Copied!

Declarative Configuration

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:
1
thundra:
2
apiKey: <your-api-key>
3
agent:
4
trace:
5
instrument:
6
traceableConfig: com.mycompany.MyAwesomeClass.doSomething[entryPoint=true]
7
application:
8
name: <your-application-name>
Copied!
Last modified 6mo ago