Installing APM agent
Installing Java Agent
The Java agent collects detailed performance metrics about applications and the computing environment as transactions are executed. The Java agent collects this information from applications and resources running on Java Virtual Machines (JVMs) and sends the information to the SixthSense platform. It then processes and stores the data for real-time and historical reporting. You can view and work with the collected data using the user interface to create alerts or take responsive action. The Java agent inserts probes into the classes bytecode of the instrumented application. Inserting the probes into the bytecode is part of the instrumentation process that enables the monitoring of your applications. After the application is instrumented, the Java agent starts collecting the data.
For java application monitoring,
- Deploy agents to monitor the performance and availability of application servers.
- Test, adjust, and optimize monitoring of application components.
- The agent uses some of the application server Java heap memory to store collected data.
- For a highly utilized heap java application, increase the heap allocation on the installation of the Java agent.
- If there are large numbers of transaction traces, increase the JVM heap size.
Prerequisites
Configuration requisites
- For prerequisite checks for agent installation, see Prerequisite checks for agent installation.
- SixthSense Java Agent Downloading the agent.
- Url/IP of the SixthSense collector (your tenant URL which will be provided by the onboarding team)
- Access token from the SixthSense portal. For accessing the token, see Accessing your access toke
Agent download requisites
Variables | About |
---|---|
TOKEN | To download the agent, an access token is required from the onboarding team |
AGENT_VERSION | SixthSense Agent Version |
Agent Configuration
To monitor any Java application you need valid licenses and access to download the SixthSense - Java Agent
Downloading the agent
Prerequisites for downloading the agent
- Private Token from the onboarding team
- Link to download a specific version
To download the agent, perform the following procedure:
- Ensure there is ingress from the internet/ from the SixthSense enabled.
- Download the agent using curl. If the agent is downloaded to Docker, install curl before proceeding.
Set up the agent
Configure the application server that needs instrumenting to include the path to the agent primary .jar file (i.e. sixthsense-agent.jar). Configure the path by editing the application server startup script, then restarting the application server. When the application server restarts, the Java Agent instruments the classes discovered for default components of the JVM and application environment. The specific steps that are involved depend on the application server.
- Unzip the downloaded Agent (See, Downloading the agent.).
- Navigate to agent.config file i.e. Agent folder/SixthSense/Config/agent.config file
Adding application information in the agent.config file
Add application name and team_id.
Set “agent.service_name” to identify your application name and the team id to identify which team your application belongs to “agent.team_id” in the dashboard.
Example: Assume USER_APP is your application name. Navigate to agent.config file i.e. Agent folder/SixthSense/Config/agent.config file and update.
Get Access Token from the SixthSense portal
- Login to the SixthSense portal.
- Go to Settings on the left pane.
- Click Access token.
- Click Show access token.
- Click Copy to copy the access token.
- Navigate to agent.config file Agent folder/SixthSense/Config/agent.config file.
- Add to property set agent.authentication in the agent.config file.
Update the backend collector URL
- Set collector.backend_service with Backend Collector URL
For OneCloud Platform use the following command:
Instrumenting Application
Add -javaagent flag
- After completing Agent configuration, while starting your application, add the JVM flag -javaagent:Path to sixthsense-agent.jar under the startup/entrypoint application file.
Example to run the Java Agent for a standalone application
- Execute the Java Agent command along with your Jar File. For example, if your application jar is named as "java_backend", use the following command.
Steps for Agent Integrations in a docker environment
- Download the SixthSense Agent (See, Downloading the agent.)
- After downloading the agent follow the procedure in Adding application information in the agent.config file.
- Setup the agent configurations as mentioned in the Instrumenting Application section.
- Integrate the agent with the Dockerfile.
Add the following command:
- Build your Docker images.
- Run your application with the Docker image created.
- On the dashboard, you will see the application name defined above.
Example for Docker
To build the docker image, the variables are passed as build arguments i.e AGENT_VERSION and TOKEN.
Configuring JavaAgent for Tomcat Server
You can configure java agent by passing arguments through environment variables. Pass the environment variables from different locations of Tomcat server as follows.
You must edit the Tomcat startup script. By default, the Tomcat startup script is catalina.sh or catalina.bat in the $CATALINA_HOME/bin directory or set the arguments in the environment variables of Tomcat.
Downloading the Agent
To Monitor any java application, you need valid licenses and access to download the SixthSense - Java Agent
- Extract the downloaded SixthSense Java Agent zip file on the server where the application must be monitored.
Prerequisites
- SixthSense Java Agent. (See Downloading the agent)
- SSL/TLS Certificates for authentication (For Agent to connect to SixthSense platform, these certificates will be provided by onboarding team).
- Url/IP of the SixthSense collector (Your tenant url which will be provided by the onboarding team)
- Access token from the SixthSense UI (See, How to connect to the Agent SixthSense Portal)
Adding application information in the Agent config file
Configure the application server that needs instrumenting to include the path to the agent primary .jar file (SixthSenseAgent.jar).
- Configure the path by editing the application server startup script.
- Restart the application server.
- When the application server restarts, the Java Agent instruments the classes discovered for default components of the JVM and application environment.
note
The specific steps that are involved depend on the application server.
- unzip and create the folder named as “ca” in the agent/ca path
- copy the ca.crt files shared to the agent/ca folder
- Add application name and team_id ,
- Set “agent.service_name” to identify your application name and team id to identify which team your application belongs to “agent.team_id” in the dashboard.
For example, assume USER_APP is your application name, navigate to Agent folder/SixthSense/Config/agent.config file.
agent.service_name=${SW_AGENT_NAME:USER_APP}
Connecting to the Agent SixthSense Portal
- Login to your SixthSense portal
- Click Settings on the left pane.
- Click Access token.
- Click Show access token.
- Click Copy to copy the access token and add to property set agent.authentication in the Agent.config file
- Navigate to agent.config file Agent folder/SixthSense/Config/agent.config file*
Set agent.authentication = ${SW_AGENT_AUTHENTICATION: AccessToken} - Set collector.backend_service with Backend Collector URL which is provided by the onboarding team.
Example: collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:d-c.34.93.18.45.sslip.io:443}*
For OneCloud Platform, use the following example:
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:133.237.176.44:80}
Unix Environments
setenv.sh
- Create a
CATALINA\_BASE/bin/setenv.sh
script if one doesn't already exist. - Configure your
setenv.sh
script to use the SixthSense agent using theCATALINA\_OPTS
environment variable:
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/full/path/to/SixthSense.jar" - After agent configuration, restart Tomcat.
- Create a
catalina.sh
- Configure your
catalina.sh
file to use the SixthSense agent using theJAVA\_OPTS
environment variable:
export JAVA_OPTS="$JAVA_OPTS -javaagent:/full/path/to/SixthSense.jar" - After Agent configuration, restart Tomcat to start monitoring.
- Configure your
Windows Environment
setenv.bat
- Create a
CATALINA\_BASE/bin/setenv.bat
script if one doesn't already exist. - Configure your
setenv.bat
script to use the SixthSense agent using theCATALINA\_OPTS
environment variable:
SET "CATALINA_OPTS=%CATALINA_OPTS% -javaagent:/full/path/to/SixthSense.jar" - After agent configuration, restart Tomcat to start monitoring.
catalina.bat
- If you use catalina.bat to launch Tomcat, set the Java_OPTS variable near the top of the file: SET Java_OPTS=%Java_OPTS% -Javaagent:/full/path/to/SixthSense.jar
- After agent configuration, restart Tomcat to start monitoring.
Configure Java Agent through service
- Navigate to Start > Apache Tomcat X.Y.Z. > Configure Tomcat > Java.
- In the Java Options text box, enter the following argument. Use forward slashes '/' for the path separator.
SET "CATALINA_OPTS=%CATALINA_OPTS% -javaagent:/full/path/to/SixthSense.jar" - For Tomcat 6, add a line break after the -Javaagent argument. -Javaagent:/full/path/to/SixthSense.jar
- Select Apply and restart Tomcat to start monitoring.