Function Compute seamlessly integrates with Application Real-Time Monitoring Service (ARMS). You can use the application performance management (APM) feature of ARMS by configuring environment variables. ARMS provides non-intrusive advanced monitoring without code changes for applications in the Java 8 runtime environment. This way, you can view various metrics of instances, such as the total number of requests, the response time, and errors. This topic describes how to connect a function to ARMS.

Background information

Function Compute seamlessly integrates with ARMS. You can use ARMS to monitor and trace functions to obtain relevant information, such as metrics of instances, tracing data, Java Virtual Machine (JVM) metrics, and code-level profiling information.
Information Description
Metrics of instances You can view various host metrics for instances, such as metrics that are related to the CPU, the memory, and requests.
Tracing data The ARMS agent automatically obtains the topological relationships between a function and its 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 errors.

Procedure

  1. Log on to the Function Compute console.
  2. In the left-side navigation pane, click Services and Functions.
  3. In the top navigation bar, select a region.
    Notice If you need to view monitoring information after your function is connected to ARMS, make sure that ARMS resides in the same region as your function.
  4. On the Services page, click the name of the specified service.
  5. On the Functions page, find the function that you want to manage. Click Configure in the Actions column.
  6. In the Environment Variables section of the Modify Function Settings page, select a method for configuring environment variables as needed.
    • Form Editor (default method)
      1. Click Add Variable.
      2. Configure the key-value pair of the environment variable.
    • JSON Editor
      1. Click JSON Editor.
      2. In the code editor, enter a key-value pair in the JSON format. The following code shows a sample key-value pair:
        {
            "FC_EXTENSIONS_ARMS_LICENSE_KEY":"iioe7jcnuk@a0bcdaec24f****"
        }
        Settings of the key-value pair:
  7. Click Save.
    After the environment variable is configured, the function is added to application monitoring of ARMS for high-performance management. You are charged for the services provided by ARMS. For more information, see Billing.

References

If the runtime environment of the function that you connect to ARMS is not Java 8, you can refer to related ARMS topics to modify related information. For more information, see Overview.

Result

After you connect the function to ARMS, you can view the monitoring information of the function in the ARMS console.
Log on to the ARMS console. Choose Application Monitoring > Application List. Then, click the name of the application that you require to view detailed monitoring information. For more information, see Application overview.
Note The application name is in the format of FC:{serviceName}/{functionName}, such as FC:Service/Function.