Installation
Follow the below steps to install Thundra Sidekick SDK to your application.

Download the Agent

Download the latest Thundra agent from the Thundra repo.

Configure the Agent

In order to configure the agent, you'll need an API key from Thundra Sidekick. You can see your API key in the Welcome Tab.

Configure by Environment Variable

The Thundra agent can be configured externally through environment variables:
    Configure the Thundra API key by setting the THUNDRA_APIKEY environment variable. This configuration is mandatory.
    Configure application name by setting the THUNDRA_AGENT_APPLICATION_NAME environment variable. This configuration is mandatory.
    Configure application stage (local, dev, lab, staging, prod, etc.) by setting theTHUNDRA_AGENT_APPLICATION_STAGE environment variable. This configuration is optional.
    Configure application version (1.0.0, 1.0.1-SNAPSHOT, etc.) by setting theTHUNDRA_AGENT_APPLICATION_VERSION environment variable. This configuration is optional.
You can configure your distributed tracing setting by using theTHUNDRA_AGENT_TRACE_INSTRUMENT_ENABLE environment variable. This configuration is optional and set as true by default. In order to see the distributed trace, it needs to be set as trueby default. If you set false, Thundra will never collect any of your data. All the data exchange will be between your app and the client over the broker, and distributed tracing integration will be disabled.
So, a sample configuration will look like this:
1
export THUNDRA_APIKEY=<YOUR-THUNDRA-API-KEY>
2
export THUNDRA_AGENT_APPLICATION_NAME=user-service
3
export THUNDRA_AGENT_APPLICATION_STAGE=dev
4
export THUNDRA_AGENT_APPLICATION_VERSION=1.0.1-SNAPSHOT
Copied!

Configure by YAML format

Thundra agent can be configured through a YAML formatted configuration file named thundra-config.yml in the classpath (for example the config file might be located under src/main/resources directory):
    Configure the Thundra API key by setting the thundra.apiKey YAML key. This configuration is mandatory.
    Configure the application name by setting thethundra.agent.application.name YAML key. This configuration is mandatory.
    Configure the application stage (local, dev, lab, staging, prod, etc.) by setting thethundra.agent.application.stage YAML key. This configuration is optional.
    Configure the application version (1.0.0, 1.0.1-SNAPSHOT, etc.) by setting the thundra.agent.application.version YAML key. This configuration is optional.
You can configure your distributed tracing setting by thundra.agent.trace.instrument.enable YAML key. This configuration is optional and set astrue by default. In order to see the distributed trace, it needs to be set astrueby default. If you set false, Thundra will never collect any of your data. All the data exchange will be between your app and the client over the broker, and distributed tracing integration will be disabled.
So, a sample configuration file thundra-config.yml will look like this:
1
thundra:
2
apiKey: <YOUR-THUNDRA-API-KEY>
3
agent:
4
application:
5
name: user-service
6
stage: dev
7
version: 1.0.1-SNAPSHOT
8
Copied!

Sample Docker Configuration

Here you can see a sample Docker configuration. It may differ from your own Docker configuration. You need to modify this sample according to your own Docker configuration.
1
FROM openjdk:8
2
RUN mkdir -p /app
3
4
# Copy app artifact
5
ADD target/<Your-App>.jar /app/<Your-App>.jar
6
7
# Copy Thundra bootstrap agent artifact.
8
# Please rename with the file you have downloaded at the first step.
9
ADD thundra-agent-bootstrap.jar /app/thundra-agent-bootstrap.jar
10
11
WORKDIR /app
12
EXPOSE 8080
13
ENTRYPOINT [ "java", "-javaagent:thundra-agent-bootstrap.jar", "-jar", "<Your-App>.jar" ]
Copied!
You can use the example below if you would like to use environment variables with docker run
1
docker run ... \
2
-e THUNDRA_APIKEY=<YOUR-THUNDRA-API-KEY> \
3
-e THUNDRA_AGENT_APPLICATION_NAME=<YOUR-APP-NAME> \
4
-e THUNDRA_AGENT_APPLICATION_STAGE=dev \
5
-e THUNDRA_AGENT_APPLICATION_VERSION=1.0.1-SNAPSHOT \
6
...
Copied!

Add Thundra to Your Application

Run the following command to add Thundra to your application.
1
java -javaagent:<path-to-thundra-agent> -jar <your-app-jar> ...
Copied!
Last modified 2mo ago