Integration Options for Containers and VMs

  • Download Thundra agent from here

  • Start your Java application with Thundra agent jar by -javaagent VM argument.

java -javaagent:<path-to-thundra-agent> -jar <your-app-jar> ...
  • The following example shows how it is configured with Dockerfile:

FROM openjdk:8
RUN mkdir -p /app
ADD target/thundra-container-demo-0.1.0.jar /app/thundra-container-demo.jar
ADD thundra-agent-bootstrap.jar /app/thundra-agent-bootstrap.jar
WORKDIR /app
EXPOSE 8080
ENTRYPOINT [ "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>

For example, thundra-config.yml can be put under src/main/resources/ folder in Maven project structure so it will be able to read from classpath directly by Thundra agent.

Thunra agent supports the following frameworks without doing any additional configuration:

  • Spring Web (4.x, 5.x)

  • Spring Boot (1.x, 2.x)

For other applications, entry point for trace should be specified programmatically (by annotation) or declaratively (by YML configuration).

Programmatic Configuration

By @Traceable annotation, you can specify the entry point of the trace, where the transaction starts, programmatically as shown in the below example:

package com.mycompany;
import io.thundra.agent.trace.instrument.config.Traceable;
@Traceable(
justMarker = true
)
public class MyAwesomeClass {
....
@Traceable(
entryPoint = true,
...
)
public void doSomething() {
}
....
}

Declarative Configuration

By thundra.agent.trace.instrument.traceableConfig property in the thundra-config.yml, you can specify the entry point of the trace, where the transaction starts, declaratively as shown in the below example:

thundra:
apiKey: <your-api-key>
agent:
trace:
instrument:
traceableConfig: com.mycompany.MyAwesomeClass.doSomething[entryPoint=true]
application:
name: <your-application-name>