Example command:
curl -O https://xxx/apm-javaagent-x.x.x.tar
Example command:
tar -xvf apm-javaagent-x.x.x.tar
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}
If your enterprise has a large number of services, you can add more complex configurations. For example:
Generally, the startup parameter is set to -javaagent:D:\javaagent-package\apm-javaagent\apm-javaagent.jar=appName=xxx,env=yyy,business=zzz,subBusiness=sss,envTag=xxx. appName indicates a component, business indicates an application, subBusiness indicates a sub-application, and envTag indicates an environment tag.
If business is not set on the web page, the system reports an error when the JavaAgent is started. If other parameters (subBusiness, appName, env, and envTag) are not set, the system automatically creates them when the JavaAgent is started.
Component names are unique under an application.