Updated on 2025-03-28 GMT+08:00

Connecting On-premises Services to APM

Background

You cannot connect on-premises services to APM using Direct Connect. To access APM, configure a proxy.

Configuration Method

If the network between your host and APM is disconnected, configure a proxy.

  1. Configure a proxy. You need to log in to the AOM 2.0 console to configure the proxy. For details, see Configuring a Proxy Area and Proxy.
  2. Configure the JavaAgent.

    1. Download the JavaAgent package to any directory of the host to be connected to APM.

      Example command:

      curl -O https://xxx/apm-javaagent-x.x.x.tar
      Download Agent 2.4.1: curl -k https://apm2-javaagent-xx-xx-x.obs.xx-xxx-4.xxxx.xxx/apm_agent_install2.sh -o apm_agent_install.sh && bash apm_agent_install.sh -ak {APM_AK} -sk {APM_SK} -masteraddress https://xx.xx.xx.xx:41333 -obsaddress https://apm2-javaagent-xx-xxxx-x.obs.xx-xxxx-x.xxxx.xxx -version 2.4.1; history -cw; history –r
    2. Run the tar command to decompress the JavaAgent package.

      Example command:

      tar -xvf apm-javaagent-x.x.x.tar
    3. Modify the apm.config file in the JavaAgent package. Add apm.proxy to the configuration file, as shown in the following figure.
      Figure 1 Configuration file
      • Agents of 2.4.1 and later support access through a proxy. Format: apm.proxy=ip:port (Obtain ip:port from the AOM console.)
      • To obtain an AK/SK, see Access Keys.
      • To obtain the master.address, see Access Addresses.

  3. Restart the application.

    1. Modify the startup script of the Java process.

      Add the path of the apm-javaagent.jar package and the component name of the Java process to the end of the Java command in the service startup script.

      Example of adding -javaagent parameters:

      java -javaagent:/xxx/apm-javaagent/apm-javaagent.jar=appName={appName}
    2. Restart the application.