Control default ARMS Java agent configurations through static configuration files.
Static configuration files modify only static and default configurations. Their priority is lower than that for dynamic configurations, Java system properties, and environment variables.
Agents V4.x and later
All configuration files are built into the JAR package. Create an external configuration file to override built-in defaults. External configuration files take precedence over built-in files but rank below dynamic configurations, Java system properties, and environment variables.
Modify agent configurations
-
Create a
.propertiesconfiguration file (for example,my-app.properties), preferably in the agent directory. -
Add the following parameters as needed. All default to empty.
Parameter
Description
arms.licenseKey
The LicenseKey for agent installation. Obtain it from the Java Application Monitor card on the Integration Center page in the Cloud Monitor 2.0 console, or by calling DescribeTraceLicenseKey through the OpenAPI platform.
arms.appName
The application name.
profiler.tags.env
The application environment tag.
profiler.tags.version
The application version tag.
profiler.tags.customtags
Custom instance tag for the application.
The last three parameters specify the tags of the instance in ARMS.
-
At agent startup, add
-Dotel.javaagent.configuration-file=/path/to/my-app.propertiesto the startup command, or set the environment variableOTEL_JAVAAGENT_CONFIGURATION_FILE=/path/to/my-app.properties.Note-
Replace
/path/to/my-app.propertieswith the absolute path of the configuration file. -
If both are set, the startup command takes precedence.
-
-
Apply the modified configuration file to any ARMS Java agent V4.x installation as needed.
Modify the reporting region
The default reporting region depends on the integration method:
-
ACK integration: The region of your ACK cluster.
-
Manual integration: The region of the OSS bucket used for agent downloads.
To change the reporting region:
Method 1
For applications deployed in an ACK cluster:
-
Update the ack-onepilot component to V4.0.0 or later.
-
Add the ARMS_REPORT_REGION environment variable to the ack-onepilot-ack-onepilot application in the ack-onepilot namespace. Set the value to an ARMS-supported region ID, such as cn-hangzhou or cn-beijing.
-
Restart the existing application or deploy a new application to report data across regions.
NoteAfter this variable is set, all applications in the cluster report data to the specified region.
Method 2
Add -Daliyun.javaagent.profileId=cn-hangzhou to the startup command, or add the ALIYUN_JAVAAGENT_PROFILEID=cn-hangzhou environment variable.
-
Replace
cn-hangzhouwith any ARMS-supported reporting region. -
If both are set, the startup command takes precedence.
Agents V3.x
Modify agent configurations
-
Go to the decompressed agent directory and find the
arms-agent.configfile.
-
Edit the
arms-agent.configfile and save your changes, or replace it with a preparedarms-agent.configfile.ImportantDo not modify other parameters. Unexpected sampling behavior may result. To modify agent configurations, see Java application custom configuration.
Parameter
Description
Default value
arms.licenseKey
The LicenseKey for agent installation. Obtain it from the Java Application Monitor card on the Integration Center page in the Cloud Monitor 2.0 console, or by calling DescribeTraceLicenseKey through the OpenAPI platform.
-
arms.appName
The application name.
-
profiler.tags.env
The application environment tag.
-
profiler.tags.version
The application version tag.
-
profiler.tags.customtags
Custom instance tag for the application.
-
profiler.collector.trace.endpoint
Endpoint for reporting trace data.
arms-dc-hz.aliyuncs.com
profiler.collector.metric.endpoint
Endpoint for reporting metric data.
cn-hangzhou.arms.aliyuncs.com
profiler.collector.meta.endpoint
Endpoint for reporting metadata.
arms-dc-hz.aliyuncs.com
profiler.collector.endpoint
Endpoint for reporting other information.
arms-dc-hz.aliyuncs.com
profiler.acm.endpoint
Endpoint for listening to ACM dynamic configurations.
addr-hz-internal.edas.aliyun.com
profiler.acm.region.id
Region of the ACM dynamic configuration.
cn-hangzhou
Note-
The
profiler.tags.env,profiler.tags.version, andprofiler.tags.customtagsparameters specify the tags of the instance monitored in ARMS. -
The last six parameters use China (Hangzhou) as an example.
-
-
Apply the modified configuration file to any ARMS Java agent V3.x installation as needed.
Modify the reporting region
The default reporting region depends on the integration method:
-
ACK integration: The region of your ACK cluster.
-
Manual integration: The region of the OSS bucket used for agent downloads.
To change the reporting region:
Method 1 (recommended)
For applications deployed in an ACK cluster:
-
Update the ack-onepilot component to V4.0.0 or later.
-
Add the ARMS_REPORT_REGION environment variable to the ack-onepilot-ack-onepilot application in the ack-onepilot namespace. Set the value to an ARMS-supported region ID. For example, you can set the value to cn-hangzhou or cn-beijing.
-
Restart the existing application or deploy a new application to report data across regions.
NoteAfter this variable is set, all applications in the cluster report data to the specified region.
Method 2 (recommended)
For a manually installed agent, obtain a new installation package in the target region, and reinstall the agent.
Method 3 (not recommended)
Modify the parameters profiler.collector.trace.endpoint, profiler.collector.metric.endpoint, profiler.collector.meta.endpoint, profiler.collector.endpoint, profiler.acm.endpoint, and profiler.acm.region.id in the configuration file. For information about the endpoints, see Endpoints.
The ARMS agent checks VPC connectivity and automatically switches to the public network on failure. Use VPC endpoints.
Agents 2.x
ARMS Application Monitoring no longer supports Java agent V2.x. Upgrade your agent to a version later than V2.x as soon as possible.