Application Real-Time Monitoring Service (ARMS) Java agents use static configuration files to control agent behavior, including application identity, instance tags, and data reporting regions.
Static configuration files have the lowest priority. Higher-priority sources, including dynamic configurations, Java system properties, and environment variables, override values set in configuration files:
Dynamic configurations (highest)
↓
Java system properties (-D flags)
↓
Environment variables
↓
Static configuration files (lowest)When both a startup command flag (-D) and an environment variable specify the same setting, the startup command flag takes precedence.
Agents V4.x and later
In V4.x agents, all default configuration files are bundled inside the JAR package. To customize settings, create an external configuration file that overrides the built-in defaults.
Configure agent parameters
Create a
.propertiesfile, such asmy-app.properties. Place it in the same directory as the agent JAR for easier management.Add parameters as needed. All parameters default to empty. The last three parameters set instance tags in ARMS. Minimal configuration example Replace the following placeholders with actual values:
Parameter Description arms.licenseKeyLicenseKey for agent installation. Obtain it from the Java Application Monitor card on the Integration Center page, or by calling the DescribeTraceLicenseKey API. arms.appNameApplication name displayed in ARMS. profiler.tags.envEnvironment tag for the monitored instance. profiler.tags.versionVersion tag for the monitored instance. profiler.tags.customtagsCustom instance tag. Placeholder Description Example <your-license-key>ARMS LicenseKey LTAI5tXxx <your-app-name>Application name my-order-service arms.licenseKey=<your-license-key> arms.appName=<your-app-name>Point the agent to your configuration file at startup. Use one of the following methods: Startup command flag Environment variable Replace
/path/to/my-app.propertieswith the absolute path to your configuration file.-Dotel.javaagent.configuration-file=/path/to/my-app.propertiesOTEL_JAVAAGENT_CONFIGURATION_FILE=/path/to/my-app.propertiesApply the modified configuration file to the installation of any ARMS agent for Java V4.x as needed.
Change the reporting region
The default reporting region depends on your integration method:
| Integration method | Default region |
|---|---|
| Container Service for Kubernetes (ACK) | Region of your ACK cluster |
| Manual installation | Region of the Object Storage Service (OSS) bucket used for the agent download |
Use one of the following methods to change the reporting region.
Method 1: ACK environment variable
For applications deployed in an ACK cluster:
Update the ack-onepilot component to V4.0.0 or later.
Add the
ARMS_REPORT_REGIONenvironment variable to theack-onepilot-ack-onepilotapplication in theack-onepilotnamespace. Set the value to a supported ARMS region ID, such ascn-hangzhouorcn-beijing.Restart existing applications or deploy new applications to apply the change.
After you add this environment variable, all applications in the cluster report data to the specified region.
Method 2: Startup command flag or environment variable
Startup command flag
-Daliyun.javaagent.profileId=<region-id>Environment variable
ALIYUN_JAVAAGENT_PROFILEID=<region-id>Replace <region-id> with a supported ARMS region ID, such as cn-hangzhou.
Agents V3.x
Configure agent parameters
In the decompressed agent directory, open the
arms-agent.configfile.
Edit the parameters in
arms-agent.configand save the file. You can also replace the file with a pre-configured version.ImportantDo not modify parameters other than those listed in the following table. Changing other parameters may cause unexpected sampling behavior. To adjust agent settings beyond these parameters, see Customize settings for a Java application.
The following table lists the parameters that you can safely modify.
NoteThe
profiler.tags.env,profiler.tags.version, andprofiler.tags.customtagsparameters specify the instance tags monitored in ARMS.The last six parameters use the China (Hangzhou) region for example only.
Parameter Description Default value arms.licenseKeyLicenseKey for agent installation. Obtain it from the Java Application Monitor card on the Integration Center page, or by calling the DescribeTraceLicenseKey API. - arms.appNameApplication name displayed in ARMS. - profiler.tags.envEnvironment tag for the monitored instance. - profiler.tags.versionVersion tag for the monitored instance. - profiler.tags.customtagsCustom instance tag. - profiler.collector.trace.endpointEndpoint for trace data reporting. arms-dc-hz.aliyuncs.com profiler.collector.metric.endpointEndpoint for metric data reporting. cn-hangzhou.arms.aliyuncs.com profiler.collector.meta.endpointEndpoint for metadata reporting. arms-dc-hz.aliyuncs.com profiler.collector.endpointEndpoint for other data reporting. arms-dc-hz.aliyuncs.com profiler.acm.endpointEndpoint for Application Configuration Management (ACM) dynamic configurations. addr-hz-internal.edas.aliyun.com profiler.acm.region.idRegion ID for ACM dynamic configurations. cn-hangzhou Apply the modified configuration file to the installation of any ARMS agent for Java V3.x as needed.
Change the reporting region
The default reporting region depends on your integration method:
| Integration method | Default region |
|---|---|
| Container Service for Kubernetes (ACK) | Region of your ACK cluster |
| Manual installation | Region of the OSS bucket used for the agent download |
Use one of the following methods to change the reporting region.
Method 1: ACK environment variable (recommended)
For applications deployed in an ACK cluster:
Update the ack-onepilot component to V4.0.0 or later.
Add the
ARMS_REPORT_REGIONenvironment variable to theack-onepilot-ack-onepilotapplication in theack-onepilotnamespace. Set the value to a supported ARMS region ID, such ascn-hangzhouorcn-beijing.Restart existing applications or deploy new applications to apply the change.
After you add this environment variable, all applications in the cluster report data to the specified region.
Method 2: Reinstall the agent (recommended)
For a manually installed agent, download a new installation package from the target region and reinstall the agent.
Method 3: Edit endpoint parameters (not recommended)
Modify the following parameters in arms-agent.config to point to the target region: profiler.collector.trace.endpoint, profiler.collector.metric.endpoint, profiler.collector.meta.endpoint, profiler.collector.endpoint, profiler.acm.endpoint, and profiler.acm.region.id. For endpoint values, see ARMS endpoints.
The ARMS agent performs Virtual Private Cloud (VPC) connectivity checks. If VPC connectivity fails, the agent automatically falls back to the public network. Use VPC endpoints whenever possible.
Agents V2.x (deprecated)
ARMS Application Monitoring no longer supports Java agents V2.x. Upgrade your agent to V3.x or later as soon as possible.