Installation
Follow the below steps to install Sidekick SDK to your application.
- Add Sidekick agent to the application by setting the
-javaagent
VM argument
In order to configure the agent, you'll need an API key from Sidekick. You can see your API key in the Welcome Tab.
The Sidekick agent can be configured externally through environment variables:
- Configure the Sidekick API key by setting the
SIDEKICK_APIKEY
environment variable. This configuration is mandatory. - Configure application name by setting the
SIDEKICK_AGENT_APPLICATION_NAME
environment variable. This configuration is mandatory. - Configure the application stage (local, dev, lab, staging, prod, etc.) by setting the
SIDEKICK_AGENT_APPLICATION_STAGE
environment variable. This configuration is optional. - Configure application version (1.0.0, 1.0.1-SNAPSHOT, etc.) by setting the
SIDEKICK_AGENT_APPLICATION_VERSION
environment variable. This configuration is optional.
When you enable distributed tracing with Thundra APM agent, tracepoint snapshot events will be correlated to active traces at the time of tracepoint snapshot has been taken. So you will be able to go to the related traces from the tracepoint snapshot event to understand what did happen in the system during the execution of overall flow/transaction.
So, a sample configuration will look like this:
export SIDEKICK_APIKEY=<YOUR-SIDEKICK-API-KEY>
export SIDEKICK_AGENT_APPLICATION_NAME=user-service
export SIDEKICK_AGENT_APPLICATION_STAGE=dev
export SIDEKICK_AGENT_APPLICATION_VERSION=1.0.1-SNAPSHOT
Sidekick agent can be configured through a YAML formatted configuration file named
sidekick-config.yml
in the classpath (for example the config file might be located under src/main/resources
directory):- Configure the Sidekick API key by setting the
sidekick.apiKey
YAML key. This configuration is mandatory. - Configure the application name by setting the
sidekick.agent.application.name
YAML key. This configuration is mandatory. - Configure the application stage (local, dev, lab, staging, prod, etc.) by setting the
sidekick.agent.application.stage
YAML key. This configuration is optional. - Configure the application version (1.0.0, 1.0.1-SNAPSHOT, etc.) by setting the
sidekick.agent.application.version
YAML key. This configuration is optional.
So, a sample configuration file
sidekick-config.yml
will look like this:sidekick:
apiKey: <YOUR-SIDEKICK-API-KEY>
agent:
application:
name: user-service
stage: dev
version: 1.0.1-SNAPSHOT
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.
FROM openjdk:8
RUN mkdir -p /app
# Copy app artifact
ADD target/<Your-App>.jar /app/<Your-App>.jar
# Copy Sidekick bootstrap agent artifact.
# Please rename with the file you have downloaded at the first step.
ADD sidekick-agent-bootstrap.jar /app/sidekick-agent-bootstrap.jar
WORKDIR /app
EXPOSE 8080
ENTRYPOINT [ "java", "-javaagent:sidekick-agent-bootstrap.jar", "-jar", "<Your-App>.jar" ]
You can use the example below if you would like to use environment variables with
docker run
docker run ... \
-e SIDEKICK_APIKEY=<YOUR-SIDEKICK-API-KEY> \
-e SIDEKICK_AGENT_APPLICATION_NAME=<YOUR-APP-NAME> \
-e SIDEKICK_AGENT_APPLICATION_STAGE=dev \
-e SIDEKICK_AGENT_APPLICATION_VERSION=1.0.1-SNAPSHOT \
...
Run the following command to add Sidekick to your application.
java -javaagent:<path-to-sidekick-agent> -jar <your-app-jar> ...
Last modified 2mo ago