Installing the Java agent in a Docker container
Installing Java agents in containerized application environments such as Docker is similar to installing them in regular server environments, except that the agent files and configurations must be part of the container image itself.
Video
Here's a quick video on how to install a Site24x7 APM Insight Java agent in a Docker container.
Please follow the steps below to achieve the same:
- Go to APM > APM Insight > Applications and click the Java icon.
- Click Download to download the APM Insight Java agent ZIP file (apminsight-javaagent.zip).
- Place it in the same local directory as your Spring Boot application JAR file.
Note
In this example, Spring Boot is the application used.
- Extract the ZIP file and locate the agent's jar and configuration files.
- Open the apminsight.conf file in any text editor to include license.key, application.name, and proxy details.
Note
You can get the license key from the Site24x7 APM Insight Java agent page.
- Next, open the Dockerfile with any text editor.
Note
The screenshot below is just an example; your actual Dockerfile content may differ. Please make the necessary changes.
- You can use the COPY command to copy all the APM Insight Java agent files to a directory inside the target container.
- Add the following environment variable:
ENV JAVA_TOOL_OPTIONS="-javaagent:[agent_directory_full_path]/apminsight-javaagent.jar"
NoteThis environment variable is set to help the APM Insight Java agent to hook with the application during startup.
- You can now use the updated Dockerfile to create your container image.
- Once the image is ready, you can start your application by spawning containers using the Docker image you created.
- Once the application is up and receiving requests, you can view the monitor under APM > APM Insight > Applications.
Related articles
How to install various APM Insight agents in a Docker container
.NET | PHP | Node.js | Python
How to install various APM Insight agents in a Kubernetes environment
Java | .NET | PHP | Node.js | Python
-
On this page
- Video
- Related articles