6 Install and Configure APM Java Agent on Jetty
Here are the requirements and instructions to install APM Java Agent on Jetty.
Jetty: Requirements and Installation Instructions
Prerequisites for Deploying APM Java Agent on a Jetty Server
-
Supported versions:
-
Jetty Server 7, 8, and 9
-
-
JDK version 1.7 or above. If you are using JDK 1.6, either use a JDK 1.6 that supports TLS 1.2 security protocol, or connect to OMC through a Gateway.
-
If the JDK version you are running doesn't support TLS 1.2 security protocol, refer to My Oracle Support Doc ID 2703411.1 before proceeding with the APM agent installation.
-
You can install one APM Agent in one instance of Jetty.
-
Other considerations:
-
The machine hosting the Jetty Server should be able to establish an HTTPS connection either directly or indirectly (using a proxy server or an Oracle Management Cloud gateway) to Oracle Management Cloud. For more information about Oracle Management Cloud gateway, see Install a Gateway.
-
The HTTPS connection must use TLS 1.2 security protocol.
-
The install user of APM Java Agent should be the same as the Jetty Server user.
-
The Jetty Server user should have read and write permissions to the directories that host the APM Java Agent, as well as the Jetty Server Home.
-
Set the JETTY_HOME
Variable
Set the JETTY_HOME
variable to point to the Jetty destination directory.
-
If you're using a Bash shell:
export JETTY_HOME=<Jetty destination directory>
-
If you're using a C shell:
setenv JETTY_HOME"<Jetty destination directory>"
Deploy a Gateway (Optional)
-
If you have an application server that does not support Transport Layer Security (TLS) protocol 1.2
-
If you have older versions of Java Application Servers with JDK less than 1.7 (for example, Oracle WebLogic 10.3.6)
Set the Gateway Variables (Optional)
Set the values for Gateway host and port.
-
If you're using a Bash shell:
export GW_HOST=<Gateway Host Name> export GW_PORT=<Gateway Port>
-
If you're using a C shell:
setenv GW_HOST "<Gateway Host Name>" setenv GW_PORT "<Gateway Port>"
If you are using more than one gateway, use the -additional-gateways
option with the provisioning script.
Download the APM Java Agent Software for Jetty
-
From the main Oracle Management Cloud menu, navigate to Administration and Agents.
-
On the Oracle Management Cloud Agents page, click the Action Menu on the top right corner of the page and select Download Agents.
The Agent Software Download page is displayed.
-
From the Agent Type dropdown list, select APM Agent.
-
Click APM Java Agent.
-
Extract the contents of the installer ZIP file.
Install and Provision APM Java Agent on Jetty
-
Before you install the APM Java Agent, log in to the machine running the application server as a user who installed the application server.
-
The application server user should have Read-Write access to the APM Java Agent directories.
To install and provision the APM Java Agent:
-javaagent:<path-to-agent>/apmagent/lib/system/ApmAgentInstrumentation.jar
to the startup command line or script for your application or microservice. java -javaagent:/u01/apmagent/lib/system/ApmAgentInstrumentation.jar -jar my-microservice-1.0.jar server config.yml
You can install and provision the APM Java Agent from an offline installer that you have received over email.
To install from the emailed ZIP, the provisioning script needs to download the configuration file from Oracle Management Cloud. Specify these additional options while running the provisioning script:
Option | Description |
---|---|
-tenant-id |
The Oracle Management Cloud tenant name. |
-omc-server-url |
The URL of the Oracle Management Cloud server. Example: https://omchost:port |
Modify the Startup Script of Your Jetty Server
Modify the startup script of your application server to invoke the Oracle Application Performance Monitoring Cloud Service configuration settings, when you start your application server.
java -jar start.jar
script of your Jetty server home: