All Products
Search
Document Center

Connect ASK clusters to ARMS Application Monitoring

Last Updated: Nov 04, 2021

You can use Application Real-Time Monitoring Service (ARMS) Application Monitoring to monitor the topologies, API requests, abnormal transactions, slow transactions, and SQL analysis of applications in serverless Kubernetes (ASK) clusters. This topic describes how to connect ASK clusters to ARMS Application Monitoring.

Prerequisites

Background information

ARMS is an Application Performance Management (APM) service that contains modules such as Application Monitoring and Prometheus Monitoring. ARMS helps you perform full-stack performance monitoring and full-trace analysis in an end-to-end manner to simplify application O&M.

After you install the ARMS Application Monitoring agent in an ASK cluster, ARMS can perform comprehensive monitoring on the applications deployed in the ASK cluster to help you easily identify abnormal and slow API operations, view request parameters, and detect system bottlenecks. This way, the efficiency of online problem diagnostics can be significantly improved. For more information, see Overview.

Step 1: Install the Application Monitoring agent

  1. Log on to the ACK console.

  2. In the left-side navigation pane, choose Marketplace > App Catalog.

  3. On the Alibaba Cloud Apps tab, click the ack-arms-pilot application.

  4. Select the cluster for which you want to install the agent and configure the parameters.

    1. Select the cluster for which you want to install the agent from the drop-down list.

    2. On the Parameters tab, specify the accessKey and accessKeySecret parameters in the YAML template.

    3. Click Create.

    arms-pilot
  5. Check the installation result.

    Click the cluster name to go to the cluster information page. In the left-side navigation pane, choose Applications > Helm to check whether the status of arms-pilot is Deployed.

Step 2: Enable Application Monitoring for applications

You can add annotations to spec > template > metadata in the YAML configuration file of an application to enable Application Monitoring.

annotations:
  armsPilotAutoEnable: "on"
  armsPilotCreateAppName: "<your-deployment-name>"

Enable Application Monitoring for a new application

  1. In the ACK console, choose Clusters in the left-side navigation pane. Then, find the cluster in which you want to create an application and click the cluster name.

  2. On the page that appears, choose Workloads > Deployments in the left-side navigation pane.

  3. In the upper-right corner, click Create from YAML.

  4. Select a namespace and a sample template from the drop-down lists, add annotations to spec > template > metadata, and then click Create.

    arms-pilot1The following example provides a complete YAML template that is used to enable ARMS Application Monitoring for an application. The Java application Spring Cloud Eureka Server is used in the example.

    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: register-server
    spec:
      replicas: 3
      serviceName: register-server
      selector:
        matchLabels:
          app: register-server
      template:
        metadata:
          labels:
            app: register-server
          annotations:
            armsPilotAutoEnable: ""on"                   # Enable ARMS Application Monitoring.
            armsPilotCreateAppName: "register-server"   # Specify the name of the application for which you want to enable ARMS Application Monitoring.
        spec:
          containers:
            - name: register-server
              image: registry.cn-hangzhou.aliyuncs.com/shuangling/eureka-server:v1
              imagePullPolicy: Always
              env:
              - name: EUREKA_DEFAULT_ZONE
                value: "http://register-server-0.register-server:8000/eureka/,http://register-server-1.register-server:8000/eureka/,http://register-server-2.register-server:8000/eureka/"
              - name: JVM_OPTS 
                value: " -Xms1024m -Xmx1536m "
              - name: MY_POD_NAME
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.name
              ports:
                - name: http
                  containerPort: 8000
                  protocol: TCP
              readinessProbe:
                httpGet:
                  path: /actuator/health
                  port: 8001
                  scheme: HTTP
                failureThreshold: 3
                initialDelaySeconds: 60
                periodSeconds: 10
                successThreshold: 1
                timeoutSeconds: 10
              volumeMounts:
              - mountPath: /Charts
                name: data
          volumes:
          - name: data
            emptyDir: {}
      podManagementPolicy: "Parallel"
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: register-server
      labels:
        app: register-server
    spec:
      clusterIP: None
      type: ClusterIP
      ports:
        - port: 8000
          targetPort: http
          protocol: TCP
          name: http
      selector:
        app: register-server

Enable Application Monitoring for an existing application

  1. In the ACK console, choose Clusters in the left-side navigation pane. Then, find the cluster where the application is deployed and click the cluster name.

  2. On the page that appears, choose Workloads > Deployments or Workloads > StatefulSets in the left-side navigation pane.

  3. Find the application for which you want to enable Application Monitoring, click More, and then select View in YAML in the Actions column.

  4. Edit the YAML template by adding annotations to spec > template > metadata.

    arms-pilot2
  5. Click Update.

    After the YAML template is updated, the container groups are recreated. This process may take some time. Wait until the rolling update is completed for all container groups before you can view the monitoring data.

Step 3: View monitoring data

After ARMS Application Monitoring is enabled, you can view data on the Application Monitoring page in the ARMS console.

  1. In the ACK console, choose Clusters in the left-side navigation pane. Then, find the cluster where the application is deployed and click the cluster name.

  2. On the page that appears, choose Applications > Deployments or Applications > StatefulSets in the left-side navigation pane.

  3. Find the application whose monitoring data that you want to view, and click ARMS Console in the Actions column.

  4. View monitoring data of the application.

    ARMS Application Monitoring can discover application topologies, capture abnormal and slow transactions, and diagnose performance issues in real time. For more information about how to use ARMS Application Monitoring, see Application overview.

    Application monitoring