Install APM Insight Java Agent in a Kubernetes Environment


Monitoring Java applications running in Kubernetes is crucial for maintaining performance, detecting issues, and optimizing resource utilization. The APM Insight Java agent provides deep visibility into application performance, tracking critical metrics such as response times, error rates, and database calls.

In a Kubernetes environment, installing the agent requires a containerized approach that integrates seamlessly with your application pods. Applications Manager offers three flexible deployment methods to suit different containerization strategies:

Prerequisites:
  1. Download the latest APM Insight Java agent ZIP file.
  2. Extract the ZIP file and locate the agent's JAR and configuration files.
  3. Open the apminsight.conf file in any text editor and enter the license.key, apm.host, application.name, and proxy details (if any).

Add the APM Insight Java agent via a Docker container

Note: Refer to this help page for detailed instructions.

This method embeds the agent directly into the application container image. Follow the steps given below to install the Java agent in a Docker container:

  1. Place all the agent files in the same local directory where your Dockerfile is located.
  2. Open the Dockerfile with a text editor, and copy all the APM Insight Java agent files to a directory inside the target container.
  3. Add -javaagent:[absolute_path_of_agent_jar]/apminsight-javaagent.jar (Java argument) to the startup command.
  4. Use the updated Dockerfile to create your container image.
  5. Once the image is ready, start your application by spawning containers using the Docker image you created.
  6. Once the application is up and receiving requests, you can view the monitor under the APM tab.

Add the APM Insight Java agent in Kubernetes via Init Containers

This method injects the agent dynamically before the application starts. Follow the steps below to integrate the APM Insight Java agent into your Kubernetes deployment using Init Containers:

Note: Refer to this KB article for detailed instructions and examples on the process.
  1. Create a Secret for the APMInsight license key in your application namespace.
  2. Create an empty volume that will be used to copy the agent files during the InitContainers process.
  3. Include the InitContainers command in your Helm chart or deployment YAML file to copy agent files from the Docker image to your volume.
  4. Mount the created volume into your application container.
  5. Include the environment variables (S247_LICENSE_KEY and JAVA_TOOL_OPTIONS) in the application deployment YAML file.

Add the APM Insight Java agent in Kubernetes via Persistent Volumes

This method mounts the agent as a shared volume across multiple containers. Follow the steps given below to set up the APM Insight Java agent for applications running in Kubernetes using Persistent Volumes:

Note: Refer to this KB article for prerequisites and detailed instructions.
  1. Create a Persistent Volume and copy all the agent files into it.
  2. Mount the volume into the application container.
  3. Create a Secret for the APMInsight license key in your application namespace.
  4. Include the environment variables (S247_LICENSE_KEY and JAVA_TOOL_OPTIONS) in the application deployment YAML file.

Thank you for your feedback!

Was this content helpful?

We are sorry. Help us improve this page.

How can we improve this page?
Do you need assistance with this topic?
By clicking "Submit", you agree to processing of personal data according to the Privacy Policy.