This topic describes how to connect built-in Java runtimes to Application Real-Time Monitoring Service (ARMS) application monitoring.
Currently, Java 8 and Java 11 versions in Java runtime are supported. If you use a custom runtime, see Custom runtime supports ARMS application monitoring extension.
Background information
After Function Compute is seamlessly integrated with ARMS, you can use ARMS to monitor and track functions and obtain relevant information, such as instance-level observability, tracing information, Java virtual machine metrics, code-level profiling information, and application security information. For more information, see What is Application Real-Time Monitoring Service?.
Feature | Description |
Instance-level observability | You can view various metrics for instances, such as metrics that are related to CPU, memory, and requests. |
Tracing | The ARMS agent automatically obtains topological relationships between functions and upstream and downstream components and related metrics. You can view the information about the components such as databases and message queues in the ARMS console. |
JVM metrics | The ARMS agent automatically obtains JVM applications. You can view the monitoring information of the JVM applications in the ARMS console, such as the number of garbage collections (GCs), heap information, and thread stack information. |
Code-level profiling information | You can view code-level profiling information of function execution, such as the amount of time consumed by each method and exceptions. |
Based on Runtime Application Self-Protection (RASP) technology, the application security feature can provide powerful security protection for applications, and resist attacks on most unknown vulnerabilities. |
Connect built-in Java runtime to ARMS
ARMS application monitoring is an internal extension. Connecting built-in Java runtime to ARMS application monitoring mainly includes the following two parts.
Use a public layer to obtain the ARMS agent
Function Compute provides ARMS agents that support Java 8 and Java 11 versions.
Runtime | Public layer ARN |
java8 |
|
java11 |
|
Set environment variables
{
"FC_EXTENSIONS_ARMS_LICENSE_KEY": "xxx",
"JAVA_TOOL_OPTIONS": "-javaagent:/opt/ArmsAgent/arms-bootstrap-1.7.0-SNAPSHOT.jar"
}
Set the environment variable
FC_EXTENSIONS_ARMS_LICENSE_KEY
with the License Key information. For information about how to obtain the License Key, see Obtain License Key information.Set the environment variable JAVA_TOOL_OPTIONS. The ARMS program in the public layer is located in the
/opt/ArmsAgent/arms-bootstrap-1.7.0-SNAPSHOT.jar
directory.
During the period between the completion of an invocation and the frozen of the instance, fees continue to generate based on the same billing rules during the invocation. For more information, see Product Billing.
Prerequisites
You have created an event function with a built-in runtime, and the runtime environment is Java 8 or Java 11. For more information, see Create an event function.
You have activated ARMS. For more information, see Activate ARMS.
Procedure
Log on to the Function Compute console. In the left-side navigation pane, click Functions.
In the top navigation bar, select a region. On the Functions page, click the target function.
On the function configuration page, click the Configurations tab.
Click the Layers tab on the left side, and click Edit. In the Edit Function Layer panel, select
{region}
in the ARN, and click Deploy. , and add the ArmsAgent layer that is compatible with the selected Java language. Modify the value ofIn the left-side navigation pane, click the Environment Variables tab, and click Edit. Add the environment variables
JAVA_TOOL_OPTIONS=-javaagent:/opt/ArmsAgent/arms-bootstrap-1.7.0-SNAPSHOT.jar
andFC_EXTENSIONS_ARMS_LICENSE_KEY=yourLicensekey
. For more information, see Set environment variables.After you update the configurations and deploy the code, the function is added to ARMS for high-performance management. You are charged for using ARMS. For more information, see Billing overview.
If you want to view monitoring information after your function is connected to ARMS, make sure that ARMS resides in the same region as your function.
Make sure that the memory size of your function is greater than 512 MB because ARMS consumes approximately 300 MB of memory.
Verification
After you connect a function to ARMS, you can view the function in the ARMS console.
You can also log on to the ARMS console. In the left-side navigation pane, choose . Then, click the name of the target application to view detailed monitoring information. For more information, see Application overview.